paper-with-me

Papers

Selective Prompt Anchoring for Code Generation

2024-08-17 · Yuan Tian, Tianyi Zhang

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.

📄 PDF Abstract BibTeX arXiv:2408.09121

Code (1)

magic-yuantian/selective-prompt-anchoring 공식 구현 pytorch

Tasks

Code Generation

Methods 이 논문이 사용한 방법론

Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…
Attention 설명 없음
BASE 설명 없음

Similar Papers 제목 키워드 기반

CVAE-based Re-anchoring for Implicit Discourse Relation Classification

2021-11-01 · Findings (EMNLP) 2021 11 · Zujun Dou, Yu Hong, Yu Sun, Guodong Zhou

Training implicit discourse relation classifiers suffers from data sparsity. Variational AutoEncoder (VAE) appears to be the proper solution. It is because ideally VAE is capable of generating inexhaustible varying sampl…

Binary ClassificationClassificationData AugmentationImplicit Discourse Relation Classification+3

NeuroArmor: Safe-Variant-Guided Representation Consistency for Selective Re-Anchoring in Jailbreak Defense

2026-06-02 · Zhongyang Lin, Ziran Zhao, Feifei Zhai, Pengyuan Liu arxiv

Large language models remain vulnerable to jailbreak attacks that hide harmful intent behind seemingly ordinary requests such as role-play, translation, encoding, adversarial suffixes, and multi-turn buildup. Existing de…

Sparse Concept Anchoring for Interpretable and Controllable Neural Representations

2025-12-13 · Sandy Fraser, Patryk Wielopolski arxiv

We introduce Sparse Concept Anchoring, a method that biases latent space to position a targeted subset of concepts while allowing others to self-organize, using only minimal supervision (labels for <0.1% of examples per …

$\mathbb{USCD}$: Improving Code Generation of LLMs by Uncertainty-Aware Selective Contrastive Decoding

2024-09-09 · Shuai Wang, Liang Ding, Li Shen, Yong Luo 외

Large language models (LLMs) have shown remarkable capabilities in code generation. However, the effects of hallucinations (e.g., output noise) make it particularly challenging for LLMs to generate high-quality code in o…

Code GenerationHumanEvalmbpp

Seeing is Believing: Robust Vision-Guided Cross-Modal Prompt Learning under Label Noise

2026-04-10 · Zibin Geng, Xuefeng Jiang, Jia Li, Zheng Li 외 arxiv

Prompt learning is a parameter-efficient approach for vision-language models, yet its robustness under label noise is less investigated. Visual content contains richer and more reliable semantic information, which remain…