Narcissus: Program Synthesis Using Context-Aware LLM Approximations

Tilman Hinnerichs, Sebastijan Dumancic, Neil Yorke-Smith
8/26/2026
cs.AIcs.LGcs.PL

No confident code implementation found for this paper.

Abstract

Large language models (LLMs) excel at programming, but not when the task fixes the target language: prompted with a grammar rare in their training data, their programs usually break the grammar or fail the given specification. Enumerative synthesizers search the space of syntactically correct programs systematically guided by LLMs; the state of the art guides them by approximating LLM proposals into rule frequencies, which loses where each construct belongs and prunes every rule the proposals miss, exactly when the proposals are wrong. We present Narcissus, a synthesizer that keeps the proposals as syntax trees and scores each expansion of a candidate program in its context: does a proposal with the same surrounding structure continue the same way, and does the expansion rebuild a fragment the proposals repeat? A regularization term keeps every rule reachable, so wrong proposals delay the solution but cannot hide it. Across five domains and two search backends, Narcissus beats static guidance at every budget and consistently outperforms re-prompting the LLM to fix its own proposals; it reaches proposal-like programs an order of magnitude sooner and solves $40\%$ of ARC tasks where the raw proposals solve $13\%$, all without a single LLM call during search.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{hinnerichs2026narcissus,
  title  = {Narcissus: Program Synthesis Using Context-Aware LLM Approximations},
  author = {Tilman Hinnerichs and Sebastijan Dumancic and Neil Yorke-Smith},
  year   = {2026},
  eprint = {2608.25657},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2608.25657v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2608.25657.svg)](https://codeofpaper.com/paper/2608.25657)

Discussion