The Commonplace
Home Papers Evidence Explore Trends Syntheses Digests About 🎲 Workforce Futures
← Papers
Direction, evidence grade, and study type are AI-generated labels (gpt-5-mini), not human-verified. Syntheses are LLM-written. "Tensions" are machine-detected candidates, not confirmed contradictions. A research-acceleration tool, not peer review. How this is built →

Small, agentic language models—boosted by multi-sampling and compiler feedback—can match or beat larger models at optimizing telescope software, cutting the compute and energy needed to port code to accelerators; this offers a practical, lower-footprint route to meeting LOFAR’s 40× computational challenge.

Enhancing SLMs for Sustainable Code Optimization in Radio-Astronomy
Elisa Chiarotto, Jingbo Li, P. Chris Broekema, Rob V. van Nieuwpoort · July 23, 2026
arxiv descriptive medium evidence 7/10 relevance Full text usable extracted full text Source PDF

Structured author observations

Linked only from stored provider relations; the raw author line above is never matched by name.

Arxiv

Latest observation:

  1. Elisa Chiarotto unresolved corpus identity
  2. Jingbo Li unresolved corpus identity
  3. P. Chris Broekema unresolved corpus identity
  4. Rob V. van Nieuwpoort unresolved corpus identity

Semantic Scholar

Latest observation:

  1. Elisa Chiarotto provider ID
  2. Jingbo Li unresolved corpus identity
  3. P. C. Broekema provider ID
  4. R. V. Nieuwpoort provider ID
Augmenting compact language models with multi-sampling generation and compiler-feedback enables them to match or exceed larger models for generating and optimizing LOFAR scientific code while using fewer computational resources.

Citation observations

Cumulative provider counts captured on specific dates; providers are never combined.

Recent Large Language Models (LLMs) can produce and optimize complex code. We investigate the use of LLMs to generate and optimize code for large-scale sciences, focusing on radio astronomy and sustainability. The LOFAR telescope is currently being upgraded, significantly increasing the sky area observed, while simultaneously processing more data faster. However, this is expected to increase the computational requirements 40-fold. This upgrade thus critically depends on rigorous performance optimization of existing software and widespread adoption of accelerators. The code base is very large, making this a daunting task. We therefore investigate and demonstrate an AI-driven approach meant to assist developers in evaluating and optimizing their code, including porting to hardware accelerators. The LOFAR community is committed to sustainable solutions, and needs to achieve these improvements without increasing the energy budget. We thus need to optimize existing codes or port them to accelerators, while making sure that the optimization process itself is also energy efficient. This poses a challenge, since LLMs are energy-intensive. We therefore propose to use Small Language Models (SLMs) instead to limit environmental impact. In this paper, we show how to enhance SLMs through the use of agentic AI. We extend the SLMs in two ways to improve code generation quality and performance: first with a multi-sampling generation strategy and second with incorporating compiler feedback. We demonstrate that multi-sampling SLMs can match or surpass larger single-generation models with fewer computational resources and that feeding compiler output back into the SLMs leads to consistent improvements across all tested models. Our approach is generic, and can also use Retrieval Augmented Generation (RAG) as well as static and dynamic analysis tools in the code generation pipeline.

Summary

Main Finding

Multi-sampling small language models (SLMs) combined with an agentic, tool-feedback loop (including Retrieval-Augmented Generation and compiler output) can match or exceed single-generation large LLMs on repository-level code-completion tasks while substantially reducing compute resources and the associated environmental cost. Feeding compiler errors back into the model consistently improves correctness by ~3–4 percentage points across tested models.

Key Points

  • Problem context: LOFAR radio-astronomy software faces a ~40× increase in computational needs from upcoming upgrades; software optimization and porting to accelerators (GPUs, etc.) are critical to meet energy budgets.
  • Two complementary approaches to sustainable AI-assisted code optimization:
  • Multi-sampling SLMs: run many generations from a small model within the same generation-time budget as a single run of a larger model, then select the best candidate.
  • Agentic feedback loop: give models access to domain documents via RAG and to tool outputs (compiler/interpreter, unit tests, static/dynamic analysis) in a revision loop so models iterate on errors.
  • Empirical claims:
    • Multi-sampling Qwen2.5-Coder-7B (k samples) can match or slightly outperform Qwen2.5-Coder-32B while using a fraction of memory/GPU resources (paper cites a 4× resource reduction example).
    • Incorporating compiler feedback into the loop yields consistent improvements of ~3–4 percentage points in performance across models.
  • Selection and reranking: naive selection by highest log-prob (logP) is used for candidate choice; an upper-bound oracle (selecting candidate by highest cosine similarity to ground-truth) shows room for improved reranking (e.g., via unit tests or execution-based verification).
  • Human-in-the-loop design: SuperRAG is intended to produce targeted suggestions (identify bottlenecks and advise fixes) rather than automatically committing code, to reduce security risks and technical debt.

Data & Methods

  • Primary benchmark: CrossCodeEval (multilingual, repository-level cross-file code completion) in the rg1 setting with cross-file context retrieved using UniXCoder similarity.
  • Experimental design for multi-sampling vs single-generation:
    • Paired comparisons using 10 random seeds → 10 groups of 150 tasks per language (Python and C#).
    • 32B model: one completion per task within a generation-time budget.
    • 7B model: k completions per task calibrated so total generation wall-clock time did not exceed the 32B model’s generation time (k = 7 for Python, k = 6 for C#).
    • Hardware used in reported experiments: 7B on one A100-SXM4-40GB GPU; 32B on four A100-SXM4-40GB GPUs (memory constraints required multi-GPU for 32B).
    • Evaluation metric: character n-gram cosine similarity between generated completion and ground truth; also computed best-cosine upper bound (oracle selection).
  • Agentic feedback loop:
    • Core idea: integrate RAG (documents, codebase context) and tools (compiler/interpreter, unit tests, static/dynamic analysis) in an iterative revision loop; feed tool outputs (e.g., compile errors) back to model as context to guide fixes.
    • Prototype experiment used an AMD EPYC 9255 system (48 cores, 768 GiB RAM) without GPUs.
    • Base models tested in feedback experiments: Qwen2.5-Coder-3B-Instruct, Qwen3-4B, Qwen3-Coder-Next (MoE 80B-A3B), CodeLlama-7b-Instruct-hf, CodeGemma-7b-it.
    • Observed improvement from compiler feedback: consistent +3–4 percentage points in tested metrics.
  • Reproducibility: code released at https://github.com/SuperCode-Leiden-University/superRAG/

Implications for AI Economics

  • Lowering operating/energy costs: Multi-sampling SLMs that match larger-model performance under the same time budget can substantially reduce GPU/memory requirements and inference energy, directly lowering operational expenses (electricity, GPU hours) for large-scale scientific code optimization and for ongoing maintenance of scientific pipelines.
  • Better cost–performance trade-offs: The study shows a practical path to improve cost-effectiveness of AI-assisted engineering: invest in orchestration (multi-sampling, retrieval, tool feedback, reranking) rather than relying solely on bigger models. This shifts capital allocation from larger model licenses / bigger GPU clusters to engineering of tooling and verification.
  • Reduced externalities and compliance with sustainability targets: For projects (like LOFAR/LENSS) with fixed energy budgets, SLM + agentic workflows can help meet ambitious scaling targets (e.g., 40× compute demand) without proportional increases in energy consumption—supporting public good science while aligning with climate/energy constraints.
  • Labor and productivity effects: AI-assisted suggestion workflows that avoid auto-committing code and keep humans in the loop may increase programmer productivity while keeping control and reducing security/technical-debt risk—altering the marginal productivity of software engineers in scientific domains.
  • Market & procurement implications: Organizations may prefer smaller-model deployments and invest in toolchains (RAG indices, test harnesses, static/dynamic analysis infrastructure) rather than premium large-model APIs; procurement strategies should account for total-cost-of-ownership including inference energy and toolchain development.
  • Policy and incentive design: Grants, procurement rules, and sustainability assessments for big-science projects should measure lifecycle AI inference costs and incentivize approaches (like SLM multi-sampling and agentic tooling) that lower operational emissions and costs.
  • Limitations and risks with economic relevance:
    • Overhead of engineering the agentic pipeline (building RAG indices, test suites, and tool integrations) has upfront costs; cost-benefit depends on codebase size and reuse.
    • Current experiments use naive selection (logP); achieving oracle-level gains requires investment in rerankers, test generation, or execution-based verification—again implying upfront engineering expenditure.
    • Model inference still carries nontrivial energy costs—SLMs reduce but do not eliminate this; widespread adoption requires careful accounting of these remaining externalities.

Overall, the paper indicates a promising, economically attractive direction: focusing investments on smarter orchestration (multi-sampling, RAG, tool feedback, reranking) and human-in-the-loop workflows can yield good code-quality/performance outcomes with substantially lower compute and energy costs than naively scaling model size.

Assessment

Paper Typedescriptive Evidence Strengthmedium — The paper presents empirical experiments showing that small LMs with multi-sampling and compiler-feedback improve code-generation and optimization outcomes on a real, large scientific codebase (LOFAR). Results are demonstrative and practically relevant, but the description lacks strong causal identification, broad benchmarking across many codebases, and detailed reporting of metrics, statistical tests, or ablation sizes that would support a 'high' rating. Methods Rigormedium — The approach is methodologically sensible (multi-sampling, compiler feedback, use of static/dynamic analysis and possible RAG) and applied to a realistic, large codebase, but the paper as described does not report full experimental details (exact models, training/fine-tuning procedures, dataset splits, energy measurement methodology, statistical confidence, or reproducibility artefacts) needed to judge the rigor as high. SampleExperiments are conducted on the LOFAR radio-astronomy codebase undergoing upgrade, comparing Small Language Models (SLMs) against larger single-generation models for code generation, optimization, and porting to accelerators; the pipeline uses multi-sampling generation strategies, compiler output feedback, and optionally RAG plus static/dynamic analysis tools; hardware and energy measurement contexts (accelerators used, size and versions of models, and exact code tasks) are discussed but not fully enumerated in the summary. Themesproductivity innovation GeneralizabilityResults are demonstrated on a single, domain-specific scientific codebase (LOFAR) and may not generalize to other languages, application domains, or code styles., Performance and energy gains depend on specific SLM architectures and compiler/toolchain support; different models or toolchains may yield different outcomes., Reported energy-efficiency advantages may be sensitive to experimental setup (hardware, measurement method, and scale) and thus not directly transferable to other computing environments., Effectiveness of multi-sampling and compiler-feedback may diminish on highly novel code or tasks lacking ample retrieval context for RAG.

Claims (11)

ClaimDirectionOutcomeConfidence & EvidenceDetails
Recent Large Language Models (LLMs) can produce and optimize complex code. Output Quality positive ability to produce and optimize complex code
Reading fidelity high
Study strength medium
not reported
0.18
The LOFAR telescope upgrade is expected to increase computational requirements 40-fold. Organizational Efficiency negative computational requirements
Reading fidelity high
Study strength medium
40-fold increase
0.18
The LOFAR upgrade critically depends on rigorous performance optimization of existing software and widespread adoption of accelerators. Adoption Rate positive need for performance optimization and accelerator adoption
Reading fidelity high
Study strength low
not reported
0.09
The LOFAR code base is very large, making performance optimization and porting to accelerators a daunting task. Organizational Efficiency negative code base size / difficulty of optimization
Reading fidelity high
Study strength low
not reported
0.09
We propose and demonstrate an AI-driven approach to assist developers in evaluating and optimizing their code, including porting to hardware accelerators. Developer Productivity positive developer assistance for code evaluation/optimization and porting
Reading fidelity high
Study strength medium
not reported
0.18
The LOFAR community needs to achieve computational improvements without increasing the energy budget; therefore optimization (or porting to accelerators) must be energy efficient, including the optimization process itself. Organizational Efficiency positive energy efficiency of code and of the optimization process
Reading fidelity high
Study strength low
not reported
0.09
Large LLMs are energy-intensive; Small Language Models (SLMs) are proposed instead to limit environmental impact. Organizational Efficiency positive environmental impact / energy consumption of model inference
Reading fidelity high
Study strength medium
not reported
0.18
SLMs can be enhanced via agentic AI in two ways: a multi-sampling generation strategy and incorporation of compiler feedback. Developer Productivity positive quality and performance of SLM-generated code
Reading fidelity high
Study strength speculative
not reported
0.03
Multi-sampling SLMs can match or surpass larger single-generation models while using fewer computational resources. Output Quality positive code generation quality (and computational resource usage)
Reading fidelity medium
Study strength medium
not reported
0.11
Feeding compiler output back into the SLMs leads to consistent improvements across all tested models. Output Quality positive improvements in code generation (as measured by model performance with compiler feedback)
Reading fidelity high
Study strength medium
not reported
0.18
The proposed approach is generic and can incorporate Retrieval Augmented Generation (RAG) as well as static and dynamic analysis tools in the code generation pipeline. Adoption Rate positive generality and extensibility of the code-generation pipeline
Reading fidelity high
Study strength speculative
not reported
0.03

Notes