NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

GenerationPrograms: Fine-grained Attribution with Executable Programs

David Wan, Eran Hirsch, Elias Stengel-Eskin, Ido Dagan, Mohit Bansal

TL;DR

This paper introduces GENERATIONPROGRAMS, a novel framework that tackles the critical issue of unreliable and uninterpretable attributions in Large Language Models (LLMs). By decomposing text generation into a two-stage process of program planning and execution using modular operations, GENERATIONPROGRAMS significantly improves the accuracy and interpretability of attributions, even enabling post-hoc analysis and refinement.

What Problem Does This Paper Address?

Large Language Models (LLMs) excel at generating text but often struggle with accurate and fine-grained attribution. This means they fail to correctly cite the sources that inform their outputs, leading to a lack of verifiability and trust. Existing methods either generate attributions alongside outputs or attempt to add them afterward, but they often don't explain how or why the model used specific source information. This "black box" nature of attribution hinders interpretability and makes it difficult to trust the generated content, especially in applications like "deep research" workflows where precise sourcing is paramount. The problem is exacerbated by the tendency of LLMs to perform better when attribution is not explicitly required, highlighting a fundamental challenge in balancing generation quality with faithful citation.

Methods

GENERATIONPROGRAMS introduces a modular, two-stage generation framework inspired by executable "code agent" architectures.

  1. Program Generation: The first stage involves an LLM generating an executable program plan. This plan is composed of a sequence of modular text operations (like paraphrasing, compression, and fusion) that are explicitly tailored to the given query and source documents. These programs are structured as trees, where leaf nodes are source sentences and intermediate nodes represent the output of neural modules.
  2. Program Execution: The second stage involves executing these generated programs using dedicated neural modules. Each module performs a specific text operation (e.g., paraphrasing a sentence, compressing information, or fusing multiple sentences). The output of each module is directly linked to its input sentences, creating a traceable program execution that naturally leads to fine-grained attributions.

A key innovation is the use of explicit instructions within the program calls, allowing for more nuanced control over how modules operate and how information is combined. This approach also allows for post-hoc attribution, where a generated text can be fed back into the framework to reconstruct the program trace and identify the sources used.

Datasets

The paper evaluates GENERATIONPROGRAMS on the following datasets:

  • ASQA: A dataset of factoid questions with retrieved Wikipedia snippets.
  • LFQA: A dataset for long-form question answering, including ground-truth documents.
  • MultiNews (MDS): A multi-document summarization task derived from the MultiNews dataset.

Key Insights and Ideas

  • Decomposition is Key: Separating the generation of an executable program plan from the actual text execution is crucial for achieving accurate and interpretable attributions.
  • Executable Programs as Explanations: The generated programs themselves serve as interpretable explanations of the model's reasoning process, allowing users to understand how and why specific content was generated.
  • Modular Operations Enable Fine-Grained Control: The use of distinct modules (paraphrase, compress, fuse, extract) allows for precise manipulation of text and direct mapping to source sentences.
  • Contributive Attribution: GENERATIONPROGRAMS moves beyond simply corroborating attributions to providing contributive attributions, explicitly showing which sources directly influenced the output.
  • Post-Hoc Attribution Powerhouse: The framework effectively functions as a post-hoc attribution method, reconstructing the generation process to identify sources for already generated text.
  • Localized Refinement: The interpretable program structure enables targeted, modular-level refinements, leading to further improvements in attribution quality without the need for full reranking.
  • Handling Long Context: Incorporating summarization techniques as a pre-processing step helps mitigate the "lost-in-the-middle" problem in LLMs, improving attribution accuracy for long documents.

Key Results

  • Significant Attribution Improvement: GENERATIONPROGRAMS consistently achieves substantial improvements in attribution F1 scores (e.g., 20.4% and 39.0% on ASQA and LFQA for document-level, and 25.2% and 28.8% for sentence-level).
  • Reduced Omission of Citations: Unlike baseline methods that omit citations, GENERATIONPROGRAMS ensures all generated sentences have citations.
  • Superior Post-Hoc Attribution: In post-hoc attribution tasks, GENERATIONPROGRAMS significantly outperforms baselines, achieving a sentence-level citation F1 of 47.4 compared to 7.8 for LLM-based prompting.
  • Effective Module-Level Refinement: Targeted refinements at the module level further boost attribution F1 scores, demonstrating the utility of the structured program.
  • Balanced Correctness: While there's a slight decrease in answer correctness in some settings, human evaluations and more nuanced LLM-based metrics show negligible differences, suggesting the trade-off is acceptable for the gains in attribution quality.

Limitations and Future Work

  • Correctness Trade-off: The paper acknowledges a slight reduction in answer correctness in some scenarios, though they argue the gains in attribution quality outweigh this. Further investigation using more robust metrics suggests this trade-off is minimal.
  • Stylistic Differences: GENERATIONPROGRAMS outputs can be more verbose than baseline methods due to its program execution approach, which can affect scores on style-sensitive metrics.
  • Future Work:
    • Incorporating additional text-based modules (e.g., decontextualization, text simplification).
  • Extending the framework to handle phrase- or paragraph-level inputs.
  • Exploring applications like pruning contexts to mitigate long input issues and detecting adversarial modifications.
  • Systematically studying how to present program-style explanations to users to enhance trust and verification.
  • Tasks requiring complex reasoning, multi-hop inference, or logical puzzle-solving are currently outside the framework's scope.

Summary updated

BibTeX
@inproceedings{wan2025generationprograms,
  author = {David Wan and Eran Hirsch and Elias Stengel-Eskin and Ido Dagan and Mohit Bansal},
  title = {{GenerationPrograms: Fine-grained Attribution with Executable Programs}},
  booktitle = {COLM},
  year = {2025},
  url = {https://openreview.net/forum?id=zTKYKiWzIm},
}
Figure