Emerging Science Journal
Vol. 10 No. 2 (2026): April

Enhancing Small Language Models for Code Generation via Strategic Decomposition and Filtering

Yuriy Perezhohin (1) NOVA Information Management School (NOVA IMS), Universidade NOVA de Lisboa, 1070-312 Lisboa, Portugal. 2) Remynd, Alameda Bonifacio Lazaro Lozano, nº 15, 1º C, 2780-125 Oeiras)
Fabian Collao (NOVA Information Management School (NOVA IMS), Universidade NOVA de Lisboa, 1070-312 Lisboa)
Mauro Castelli (NOVA Information Management School (NOVA IMS), Universidade NOVA de Lisboa, 1070-312 Lisboa)



Article Info

Publish Date
01 Apr 2026

Abstract

This study addresses the challenge of enhancing Small Language Models (SLMs) for complex code generation tasks requiring structured planning, which current models struggle with due to their monolithic, single-pass generation approach. A three-stage pipeline architecture is proposed that decouples strategic planning from implementation: (1) an SLM generates diverse natural language strategies at high temperature, (2) a filtering mechanism selects high-quality strategies while removing noise, and (3) refined strategies guide a specialized coding model for final implementation. The approach was evaluated on the ClassEval benchmark for class-level code generation. The pipeline enabled a 1.5B parameter model to achieve 13% class success rate, representing a 30% relative improvement over direct generation (10%) and competitive performance with models 5-8 times larger. Critically, effective strategy filtering proved more important than strategy diversity, with simple pattern-based filters successfully mitigating SLM artifacts like few-shot contamination. This work demonstrates that structured, inference-time computation offers an efficient alternative to parameter scaling, with strategic noise reduction being the key driver of performance gains in resource-constrained models.

Copyrights © 2026






Journal Info

Abbrev

ESJ

Publisher

Subject

Environmental Science

Description

Emerging Science Journal is not limited to a specific aspect of science and engineering but is instead devoted to a wide range of subfields in the engineering and sciences. While it encourages a broad spectrum of contribution in the engineering and sciences. Articles of interdisciplinary nature are ...