Pith. sign in

REVIEW 2 cited by

Selective Prompt Anchoring for Code Generation

Not yet reviewed by Pith; the record is open.

This paper has not been read by Pith yet. Machine review is queued; the pith claim, tier, and objections will appear here once it completes.

SPECIMEN: schema-true, not a live event

T0 review · schema-true

One-sentence machine reading of the paper's core claim.

pith:XXXXXXXX · record.json · timestamp

arxiv 2408.09121 v6 pith:GAS5R5ZJ submitted 2024-08-17 cs.LG cs.AIcs.CLcs.SE

classification cs.LGcs.AIcs.CLcs.SE
keywords codellmsattentiongeneratinggenerationuseranchoringintent
verification ladder T0 review T1 audit T2 compute T3 formal
0 comments
read the original abstract

Recent advances in large language models (LLMs) have transformed software development by automatically generating code from natural language. Yet challenges remain in generating fully correct code that aligns with user intent. Our study reveals that LLMs tend to pay less attention to user prompts as more code tokens are generated. We hypothesize that this attention dilution issue is an important reason for code generation errors. To mitigate this issue, we propose Selective Prompt Anchoring (SPA) to guide code LLMs to pay more attention to user intent when generating code. We evaluate SPA using six base LLMs across six benchmarks. Our results demonstrate that SPA enhances Pass@1 by up to 12.9%, consistently outperforming SOTA code generation methods in all settings. Our code is available at https://github.com/magic-YuanTian/Selective-Prompt-Anchoring.

Discussion (0). Continue with ORCID to comment.

Forward citations

Cited by 2 Pith papers

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score. Full citation record

  1. Training-Free Token-Level Steering for LLM Personalized Co-Writing

    cs.CL 2026-08 conditional novelty 6.0 of 10

    A token-level, training-free steering framework that improves LLM personalized co-writing by mixing the base model's posterior with a kernel-density estimate from a small user dataset.

  2. The Language of Security: How Prompt Syntax Shapes Secure Code Generation in Open LLMs

    cs.CR 2026-07 conditional novelty 6.0 of 10

    Removing certain syntactic parts of prompts—especially entity-binding phrases and late-sentence constraints—makes open LLMs generate more vulnerable code, with the strongest effect in Python.

Pith tools