Beyond In-Context Learning: Aligning Long-form Generation of Large Language Models via Task-Inherent Attribute Guidelines
Do Xuan Long, Duong Ngoc Yen, Do Xuan Trong, Luu Anh Tuan, Kenji Kawaguchi, Shafiq Joty, Min-Yen Kan, Nancy F. Chen · 2025
Read Beyond In-Context Learning: Aligning Long-form Generation of Large Language Models via Task-Inherent Attribute Guidelines by Do Xuan Long, Duong Ngoc Yen, Do Xuan Trong, Luu Anh Tuan, Kenji Kawaguchi, Shafiq Joty, Min-Yen Kan, Nancy F. Chen (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2506-01265.txt.
Introduction
Do Xuan Long and co-authors argue that showing a language model a few examples is not enough to teach it long-form writing, in a paper from 2025. Examples shine in question answering. In summaries and essays, models still miss the target language and shape.
The fix is to state the task's own rules outright. Their system drafts two guide streams: score guides that name what to self-check, and shape guides that bound the output at word and sentence level. The best mix is picked on its own. Gains topped five percent for strong open and closed models, with or without examples. The work reframes prompting as rule-giving, not just example-showing.
Catalog record
| CREATOR | Do Xuan Long, Duong Ngoc Yen, Do Xuan Trong, Luu Anh Tuan, Kenji Kawaguchi, Shafiq Joty, Min-Yen Kan, Nancy F. Chen |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 90 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2506-01265
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Beyond In-Context Learning: Aligning Long-form Generation of Large Language Models via Task-Inherent Attribute Guidelines Do Xuan Long, Duong Ngoc Yen, Do Xuan Trong, Luu Anh Tuan, Kenji Kawaguchi, Shafiq Joty, Min-Yen Kan, Nancy F. Chen Abstract In-context learning (ICL) is an important yet not fully understood ability of large language models (LLMs). It can greatly enhance task performance using a few examples, termed demonstrations , without fine-tuning. Although effective in question answering, ICL often underperforms in long-form generation tasks such as summarization. Under appropriately realistic assumptions, we empirically and theoretically show that ICL demonstrations alone are insufficient to teach LLMs the task’s language and format distributions for generation. We argue for explicit exposure to the task distributions and hypothesize that defining them by prompting enhances model performance. To this end, we present LongGuide, which efficiently generates two parallel streams of guidelines capturing task language and format properties: (i) Metric Guidelines (MGs) that instruct models to optimize self-evaluated metrics; and (ii) Output Constraint Guidelines (OCGs) that constrain generation at both token and sentence levels. LongGuide automatically selects the best combination of guidelines, improving both strong open- and closed-source LLMs by over 5% in both zero- and few-shot settings. LongGuide is generalizable, learnable by weak models to enhance strong ones, and integrates synergistically with automatic prompt optimizers 1 1 1 Our codes and data will be made available at here . . 1 Introduction In recent years, pre-trained large language models (LLMs) have demonstrated impressive instruction-based performance through zero- and few-shot learning capabilities ( Brown et al. 2020 ; Chowdhery et al. 2022 ; OpenAI 2022 ; Touvron et al. 2023 ; Jiang et al. 2023 ; Team et al. 2023 ) . Notably, few-shot learning, termed as in-context learning (ICL), has proven highly effective and widely used to calibrate LLMs for applications ( Dong et al. 2022 ) . Formally, let \mathcal{V} be the vocabulary of the LM. For a test-time task T , the goal is to generate a token sequence y\in\mathcal{Y}\subseteq\mathcal{V}^{*} , given input token sequence x\in\mathcal{X}\subseteq\mathcal{V}^{*} . Then, ICL generation using an LLM \mathcal{M} is the generation conditioned on x with k task demonstrations \{(x_{1},y_{1}),...,(x_{k},y_{k})\} concatenated into d_{f}=[x_{1},y_{1},...,x_{k},y_{k}]\in\mathcal{D}\subseteq\mathcal{V}^{*} . The probability distribution induced from \mathcal{M}:\mathcal{V^{*}}\rightarrow\mathbb{R} is: \displaystyle P_{\mathcal{M}}(y|d_{f},x):= \displaystyle\prod_{t=1}^{|y|}\mathcal{M}_{y^{t}}([x_{1},y_{1},\dots, (1) \displaystyle x_{k},y_{k},x,y^{<t}]) Figure 1: ChatGPT results on a SAMSum example ( Gliwa et al. 2019 ) . With LongGuide, the generated output aligns better with ground truth, and the quality is also improved by removing verbose details: “The dialogue…” (ZS), “…discuss their day” (FS). See Appx.- Figure 14 for full texts. where y=[y^{1},\dots,y^{|y|}] with y^{t}\in\mathcal{V} . Several prior studies attempt to explain the ICL capabilities of LLMs, advocating for the sufficiency of well-chosen d_{f} as implicitly teaching the \mathcal{M} to perform the tasks, especially classification ones ( Saunshi et al. 2020 ; Xie et al. 2021 ; Wang et al. 2024 ) . Central to their theoretical analyses is a strong assumption that the language model \mathcal{M} fully captures the underlying distribution of the task’s language; i.e., P_{\mathcal{M}}(X)=P_{T}(X) where P_{T} is the task-specific data distribution. However, this assumption is often not met, especially with domain-specific terminologies ( Cheng et al. 2024 ) (also see Section C.1 for a case study), raising concerns about the actual sufficiency of ICL. Moreover, recent studies empirically show that ICL underperforms in long-form generation tasks involving multi-sentence or -paragraph answers ( Sun et al. 2023a ; Huang et al. 2024 ) , highlighting significant gaps in our understandings of the causes of these limitations and how to effectively instruct LLMs for these tasks. These challenges remain unsolved to date. In this work, we first study the proficiency of ICL for long-form generation tasks. We empirically and theoretically highlight that if a language model fails to capture the task’s text properties (language and format) , providing demonstrations alone with such properties cannot entirely resolve this ( Section 2 ). This is because the model does not consistently apply them to all generated responses. Maintaining such properties in responses is crucial for accurately solving the task. Therefore, we argue that providing explicit task guidelines that capture these text properties is essential for improving LLM performance. Figure 1 illustrates such an example where instructing LLMs explicitly by guidelines carrying certain properties (e.g., conciseness, #sentences) of the task output distribution improves both alignment with ground truth and generation quality. We then propose LongGuide ( Section 3 ), a guideline-learning algorithm that efficiently 2 2 2 The prompts and cost analysis are discussed in Appendix G . generates two types of guidelines concurrently from limited task training data as supplementary instructions to enhance LLMs: (i) Metric Guidelines (MGs) that steer models to optimize self-evaluation guided metrics, inspired by prior studies in machine translation ( Ranzato et al. 2015 ) and LLM self-evaluation ( Ren et al. 2023 ) ; and (ii) Output Constraint Guidelines (OCGs) that impose constraints on generated outputs at the sentence and token levels, drawing on controllable generation research ( Fan et al. 2018a ) . LongGuide is related to previous studies in task instruction construction ( Wang et al. 2022b ) and task understanding through task definitions ( Yin et al. 2023 ) . However, it differs by offering “post-hoc” instructions that guide LLMs to enhance responses based on learned quality and quantitative criteria. LongGuide automatically identifies optimal guidelines, significantly enhancing distribution alignment and generation quality across seven generation tasks and one real-life chat LLM benchmark , including summarization, text simplification, translation, dialogue generation, and table-to-text generation. Its guidelines can enhance ICL performance through demonstrations ( Section 5.2 ), improve non-instruct LLMs ( Section D.1 ), boost stronger models when learned by weaker ones ( Section D.2 ), and can be further optimized for usage using prompt optimization algorithms ( Section D.3 ). Notably, LongGuide is approximately at least 3.75 times more cost-efficient than prompt optimization algorithms ( Section G.3 - Table 20 ) as it requires only four prompt variants to verify on the validation set while delivering superior performance. 2 ICL Alone Is Insufficient for Long-form Generation A long-form generation task T with n samples is defined as D=\{(x^{t}_{i},y^{t}_{i})\}_{i=1}^{n} where x^{t}_{i} and y^{t}_{i} are input contexts and ground-truth sentence- or paragraph-long responses ( Fan et al. 2019 ) . For such tasks, preserving language and format properties of task-specific data during generation is essential for aligning outputs with ground truth. This is unlike classification, where outputs are predefined. We demonstrate that ICL fails to enable LLMs to maintain these properties during generation. ICL w/ 5 demos (1) COV (2) FAC (3) CON (4) INF (5) COH (6) REL (7) NT (mean) (7) NT (std) Expected outcome 100% 100% 100% 100% 100% 100% 17.00 0.00 Mistral-7B-v0.3 12% 27% 28% 8% 20% 35% 87.74 144.91 Llama-3.1-8B 12% 42% 50% 4% 32% 47% 271.81 379.48 Qwen2.5-7B 43% 90% 85% 40% 78% 96% 281.38 264.59 Mistral-7B-it-v0.2 38% 80% 78% 17% 75% 88% 50.25 55.54 Llama-3.1-8B-it 44% 86% 82% 26% 81% 87% 34.72 45.29 Table 1: % of responses scored 5 on the (1)-(6) metrics, and the (mean, std) of the (7) #tokens of the responses. Qwen scored high on metrics (1)–(6) because it copies the input dialogue as the summarization outcome. Setups. We first select metrics