aspireai.
PUBLIC EDITION

Constrained Beam Decoding with Lookup makes LLM-generated tests fail on logic instead of on imports

AspireAI community · arXiv
Import errors are one of the most common failure reasons in LLM-based test generation pipelines. Grammar-constrained decoding can guarantee valid imports by reshaping the final layer's probabilities, but the authors find it produces degenerate solutions - repetitive valid imports, or import streaks, that burn the token budget before a test is ever generated. Constrained Beam Decoding with Lookup (CBDL) targets that specific failure by avoiding premature commitment to tokens that lead to repetitive imports, and because it operates at the decoding stage it drops into existing pipelines. Implemented for Python and Java, the authors report 100% valid imports in the generated tests, against static approaches (RAG and LIBRO) and dynamic agentic repair that leave 45%, 10% and 43% of import errors unresolved. CBDL converts on average 14% of initial import errors into functionally correct tests, raising overall test correctness by 1-4 percentage points over unconstrained generation, and lets agentic repair pipelines spend budget on other errors for a further 2-7 points in Python and 1-6 in Java. The honest cost is that CBDL adds 16-21 seconds per test, and the results are on the authors' two test-generation tasks.
Read the story and explore more from the AspireAI community.
Discover more stories
Stay curious.
THE BIG PICTURE
A FRESH PERSPECTIVE
Research
One distance function matched sparse-autoencoder features across layers and compressed feature circuits into supernodes
Two sparse-autoencoder analyses have resisted scaling: matching semantically similar features across layers, and compressing large feature circuits into interpretable supernodes. This paper argues both are the same underlying problem, estimating semantic distances between SAE features that sit on different activation manifolds. Its representation treats each feature not as a single decoder vector but as an activation-weighted distribution over the hidden states expressing it, projects those distributions into a shared reference space, and compares them with Wasserstein distance. The representation is proved invariant to activation rescaling and stable under perturbation, and recovers true matches under finite-sample margin conditions. Empirically it outperformed decoder-vector and LLM-based baselines and captured subtle functional distinctions between related features, and it compressed large feature circuits into interpretable supernodes automatically. The limitation is that this is interpretability tooling: the paper demonstrates better feature matching and circuit compression, not that downstream interpretability claims become more accurate.
Swipe into something new
01 / 1729
The conversation continues
Explore Builds — projects by Kiran Adimatyam ↗
A fresh perspective changes everything.
ASPIREAI — STAY CURIOUS.