Source-linked AI summary

Instruction Position Matters in Sequence Generation with Large Language Models

Yijin Liu, Xianfeng Zeng, Fandong Meng, Jie Zhou

arXiv:2308.12097v1cs.CL

TL;DR

Long inputs can cause instruction forgetting because decoder self-attention favors nearby tokens in conventionally concatenated instruction-following data. The paper moves the task instruction after the input, and reports consistent gains across models and sequence-generation tasks, including up to 9.7 BLEU points in zero-shot translation.

  • Problem

    Long input sequences can cause models to forget task instructions when self-attention emphasizes nearby tokens.

    Source: §1 · p. 2
  • Method

    Post-Ins relocates the task instruction after the input sentence so it remains near the response-generation context.

    Source: §1 · p. 2
  • Results

    Post-Ins consistently outperforms Pre-Ins across model scales and translation and summarization tasks, with zero-shot gains up to 9.7 BLEU points.

    Source: §1 · p. 2, §6 · p. 9
  • Takeaways & Limitations

    Instruction position is a key factor in instruction fine-tuning, and Post-Ins improves instruction following without additional data or annotation costs.

    Source: §1 · p. 2, §6 · p. 9

    The theoretical analysis assumes that input and response are approximately independent when no specific task instruction is given.

    Source: §3.3 · p. 4

Abstract

from arXiv · show

Large language models (LLMs) are capable of performing conditional sequence generation tasks, such as translation or summarization, through instruction fine-tuning. The fine-tuning data is generally sequentially concatenated from a specific task instruction, an input sentence, and the corresponding response. Considering the locality modeled by the self-attention mechanism of LLMs, these models face the risk of instruction forgetting when generating responses for long input sentences. To mitigate this issue, we propose enhancing the instruction-following capability of LLMs by shifting the position of task instructions after the input sentences. Theoretical analysis suggests that our straightforward method can alter the model's learning focus, thereby emphasizing the training of instruction-following capabilities. Concurrently, experimental results demonstrate that our approach consistently outperforms traditional settings across various model scales (1B / 7B / 13B) and different sequence generation tasks (translation and summarization), without any additional data or annotation costs. Notably, our method significantly improves the zero-shot performance on conditional sequence generation, e.g., up to 9.7 BLEU points on WMT zero-shot translation tasks.

1 Introduction

Instruction fine-tuning can suffer from instruction forgetting on long inputs because decoder self-attention favors nearby tokens. The paper proposes moving instructions after inputs and reports stronger instruction following and sequence-generation performance.

1 Introduction

  • Long inputs risk instruction forgetting because local self-attention can make the model lose track of an initial instruction.This is especially relevant when inputs contain thousands of tokens, such as long summarization inputs.Source: §1 · p. 2
  • Post-Ins relocates the task instruction after the input sequence, keeping the instruction nearest to the response being generated.The existing format, Pre-Ins, places the instruction before the input.Source: §1 · p. 2
  • Theoretical analysis concludes that Pre-Ins emphasizes reverse conditional probabilities, whereas Post-Ins more strongly models task-instruction conditioning.The analysis uses trinomial Bayes formula and links Post-Ins to instruction-following capability.Source: §1 · p. 2
  • Post-Ins consistently outperforms Pre-Ins across LLaMA and BLOOMZ models from 1.7B to 13B on translation and long-text summarization.The experiments use two sequence-generation tasks without additional supervised data.Source: §1 · p. 2
  • Zero-shot translation improves by up to 9.7 BLEU points, while human analysis finds more instruction-faithful responses and fewer hallucination responses.These gains are attributed in the passage to stronger modeling of task instructions.Source: §1 · p. 2

2 Background

Instruction fine-tuning builds on instruction-following datasets and has been extended by methods targeting alignment and sequence generation. This paper identifies the conventional Pre-Ins format as a potential source of instruction forgetting.

2 Background

  • Instruction fine-tuning research includes InstructGPT, Alpaca, contrastive and error-guided translation instructions, and interactive translation task training.The cited work spans general instruction learning and machine-translation-specific approaches.Source: §2 · pp. 2–3
  • The paper argues that prior studies using Pre-Ins face a potential instruction forgetting issue that its method addresses.This claim is presented as the motivation for changing instruction position.Source: §2 · p. 3

3 Approach

The approach identifies instruction forgetting in Pre-Ins sequences and proposes Post-Ins, which places the task instruction after the input to emphasize instruction following. Theoretical analysis contrasts Post-Ins's instruction modeling with Pre-Ins's emphasis on input coverage, while preliminary experiments reveal length-sensitive failures and hallucinations.

3.1 Definition

  • Long inputs can cause Pre-Ins models to forget front-positioned instructions, producing responses that do not follow the task.Decoder-only self-attention tends to emphasize nearby tokens, creating this risk for lengthy sequence-generation inputs.Source: §3.1 · p. 3

3.2 Preliminary Observations on Pre-Ins

  • Pre-Ins performance varies with training and test sentence lengths, and longer-input settings can produce translation hallucinations.The preliminary experiments report weaker performance when train and test lengths differ, including failures on shorter datasets after training on longer sentences.Source: §3.2 · pp. 3–4, Figure 3 · p. 4

3.3 Post-Instruction

  • Post-Ins places the task instruction after the input so it remains close to the response during generation.The format is intended to preserve access to task requirements regardless of input length.Source: §3.3 · p. 4
  • Post-Ins theoretically models response fluency together with the probability of identifying the task instruction from the input and response.The latter component is described as strengthening perception of the instruction requirements.Source: §3.3 · p. 4

3.4 Post-Instruction versus Pre-Instruction

  • Pre-Ins instead emphasizes modeling the input given the instruction and response, resembling coverage modeling and providing less direct task-instruction modeling.The paper argues this can be adequate for a single task or a small number of tasks but problematic across multiple sequence-generation tasks.Source: §3.4 · p. 4
  • Across multiple sequence-generation tasks, Post-Ins is presented as having stronger instruction transferability than Pre-Ins.The paper states that this is experimentally verified in zero-shot translation and supported by attention-distribution analysis.Source: §3.4 · p. 5

4 Experiments and Evaluations

The experiments evaluate instruction-position formats on translation and long-text summarization using established datasets and controlled inference settings. Evaluation uses translation and summarization metrics, with WMT-2022 results summarized across models and instruction modes.

4.1 Datasets

  • The study evaluates instruction formats on WMT translation data, zero-shot translation directions, FLORES-200, MQM, and CNN/DailyMail summarization.CNN/DailyMail supplies long-news-article summarization examples, while MQM is used only for translation.Source: §4.1 · p. 5

4.2 Evaluation

  • Inference uses batch size 1, temperature 0.1, and beam search, with beam sizes of 4 for translation and 2 for summarization.The smaller summarization beam size reflects GPU-memory consumption from long inputs.Source: §4.2 · pp. 5–6
  • Table 1 compares SacreBLEU and COMET22 across models and instruction modes on WMT-2022 test sets, with bold scores marking best comparable results above 7B parameters.Scores marked with an asterisk use additional supervised data and are not directly comparable with other results.Source: Table 1 · p. 6
  • Translation evaluation reports SacreBLEU and COMET22, while summarization evaluation reports ROUGE-1, ROUGE-2, and ROUGE-L F1 scores.The metrics are selected for translation quality and long-text summarization evaluation.Source: §4.2 · p. 6

5 Main Results and Analysis

Post-Ins improves conditional sequence generation by placing task instructions after inputs, with gains across translation, long-text summarization, self-attention behavior, and human-rated instruction following.

5.1 Results of Machine Translation

  • Post-Ins consistently improves translation over Pre-Ins, including up to +7.20 BLEU and +6.16 COMET22 on FLORES-200 and strong WMT22 gains.On WMT22, improvements reach +6.67 BLEU and +4.96 COMET22 for LLaMA-7B English-to-Chinese translation.Source: §5.1 · p. 6
  • Post-Ins improves zero-shot translation, reaching +9.7 BLEU in WMT22 German-to-French translation and averaging +0.7 BLEU for BLOOMZ.Average gains are +1.9 BLEU for LLaMA-7B and +1.1 BLEU for LLaMA-13B.Source: §5.1 · p. 7

5.2 Results of Text Summarization

  • Post-Ins improves long-text summarization on CNN/DailyMail, with gains up to +3.49 in BLOOMZ-3B across ROUGE metrics.The task uses inputs averaging more than 1,000 tokens, directly testing instruction forgetting in long sequence generation.Source: §5.2 · pp. 7–8, Table 4 · p. 7

5.3 Distributions of Self-attention

  • Self-attention visualizations show Post-Ins attends more to task instructions during response generation, whereas Pre-Ins emphasizes the source input more strongly.Both formats also learn latent word-alignment behavior by attending to aligned source parts during generation.Source: §5.3 · pp. 8–9

5.4 Human Analysis

  • Human evaluation of 1,000 English-to-Chinese translations found hallucination rates of 4.8% for Pre-Ins versus 1.7% for Post-Ins.Annotators judged whether outputs followed both the translation instruction and source input.Source: Figure 5 · p. 8, §5.4 · p. 9

6 Conclusion

The paper concludes that task-instruction position is important for instruction fine-tuning in conditional sequence generation. Post-Ins shifts instructions after the input and improves performance across model scales and translation and summarization tasks without additional data or annotation costs.

6 Conclusion

  • Post-Ins relocates task instructions after the input sequence and improves instruction following across model scales and machine translation and long-text summarization tasks.The conclusion describes the method as shifting the model’s learning focus toward instruction following.Source: §6 · p. 9
  • Post-Ins boosts zero-shot performance without additional data or annotation costs.The paper presents this as a promising direction for further research and practical applications.Source: §6 · p. 9
Loading 2308.12097v1…