Yu Huang

h-index8
2papers
326citations

2 Papers

9.3SEJul 7
DPO-F+: Aligning Code Repair Feedback with Developers' Preferences

Zihan Fang, Yifan Zhang, Yueke Zhang et al.

Large Language Models (LLMs) are increasingly used in software engineering tasks, especially code repair. However, developers often struggle to interpret model outputs, limiting effective human--AI teaming, where humans and AI work toward a shared objective. Prior work mainly optimizes generated code, giving less attention to natural-language feedback that supports comprehension and iterative improvement. We present \textsc{DPO-f+}, a framework that aligns code-repair feedback with the needs of different developer groups, including novices and proficient developers. It (1) defines feedback-alignment metrics across seven fixed dimensions with task-specific descriptions; (2) automatically constructs pairwise preference datasets from code-repair tasks; (3) fine-tunes models using Direct Preference Optimization (DPO) augmented with a reward model; and (4) provides an automated protocol for evaluating feedback quality. Empirically, \textsc{DPO-f+} outperforms both the baseline and standard DPO in feedback accuracy and overall alignment. On novice programming tasks, \textsc{DPO-f+} improves Pass@1 by 5.71 percentage points (pp) over the baseline and 3.30 pp over DPO. On \textsc{SWE-Bench}, it improves issue-resolution rate by 1.67 pp over DPO and 4.67 pp over the baseline. It also improves feedback alignment by both LLM judges and a human study with 200 developers: beginners preferred \textsc{DPO-f+} in 71.5% of comparisons, with overall preference above chance ($p=0.0057$). By better aligning feedback with developer needs, \textsc{DPO-f+} turns LLM assistance from a one-shot output into a collaborative sense-making workflow, enhancing code comprehension and human--AI teaming in software engineering.

17.9LGJun 5, 2025
Transformers Meet In-Context Learning: A Universal Approximation Theory

Gen Li, Yuchen Jiao, Yu Huang et al.

Large language models are capable of in-context learning, the ability to perform new tasks at test time using a handful of input-output examples, without parameter updates. We develop a universal approximation theory to elucidate how transformers enable in-context learning. For a general class of functions (each representing a distinct task), we demonstrate how to construct a transformer that, without any further weight updates, can predict based on a few noisy in-context examples with vanishingly small risk. Unlike prior work that frames transformers as approximators of optimization algorithms (e.g., gradient descent) for statistical learning tasks, we integrate Barron's universal function approximation theory with the algorithm approximator viewpoint. Our approach yields approximation guarantees that are not constrained by the effectiveness of the optimization algorithms being mimicked, extending far beyond convex problems like linear regression. The key is to show that (i) any target function can be nearly linearly represented, with small $\ell_1$-norm, over a set of universal features, and (ii) a transformer can be constructed to find the linear representation -- akin to solving Lasso -- at test time.