Table of Contents
Fetching ...

N-gram Prediction and Word Difference Representations for Language Modeling

DongNyeong Heo, Daniela Noemi Rim, Heeyoul Choi

TL;DR

The paper introduces a simple N-gram prediction framework for causal language modeling (CLM) and a novel Word Difference Representation (WDR) as diverse, contextualized target embeddings. It also proposes an ensemble mechanism to fuse multiple future-word predictions, aiming to mitigate over-reliance on local dependencies. Empirical results across CLM benchmarks and neural machine translation show consistent improvements over baselines, with WDR often delivering larger gains and gradient-diversity benefits supporting better generalization. The approach extends to NMT tasks with notable BLEU gains and offers avenues for future MLM integration, albeit with some limitations on MLM tasks.

Abstract

Causal language modeling (CLM) serves as the foundational framework underpinning remarkable successes of recent large language models (LLMs). Despite its success, the training approach for next word prediction poses a potential risk of causing the model to overly focus on local dependencies within a sentence. While prior studies have been introduced to predict future N words simultaneously, they were primarily applied to tasks such as masked language modeling (MLM) and neural machine translation (NMT). In this study, we introduce a simple N-gram prediction framework for the CLM task. Moreover, we introduce word difference representation (WDR) as a surrogate and contextualized target representation during model training on the basis of N-gram prediction framework. To further enhance the quality of next word prediction, we propose an ensemble method that incorporates the future N words' prediction results. Empirical evaluations across multiple benchmark datasets encompassing CLM and NMT tasks demonstrate the significant advantages of our proposed methods over the conventional CLM.

N-gram Prediction and Word Difference Representations for Language Modeling

TL;DR

The paper introduces a simple N-gram prediction framework for causal language modeling (CLM) and a novel Word Difference Representation (WDR) as diverse, contextualized target embeddings. It also proposes an ensemble mechanism to fuse multiple future-word predictions, aiming to mitigate over-reliance on local dependencies. Empirical results across CLM benchmarks and neural machine translation show consistent improvements over baselines, with WDR often delivering larger gains and gradient-diversity benefits supporting better generalization. The approach extends to NMT tasks with notable BLEU gains and offers avenues for future MLM integration, albeit with some limitations on MLM tasks.

Abstract

Causal language modeling (CLM) serves as the foundational framework underpinning remarkable successes of recent large language models (LLMs). Despite its success, the training approach for next word prediction poses a potential risk of causing the model to overly focus on local dependencies within a sentence. While prior studies have been introduced to predict future N words simultaneously, they were primarily applied to tasks such as masked language modeling (MLM) and neural machine translation (NMT). In this study, we introduce a simple N-gram prediction framework for the CLM task. Moreover, we introduce word difference representation (WDR) as a surrogate and contextualized target representation during model training on the basis of N-gram prediction framework. To further enhance the quality of next word prediction, we propose an ensemble method that incorporates the future N words' prediction results. Empirical evaluations across multiple benchmark datasets encompassing CLM and NMT tasks demonstrate the significant advantages of our proposed methods over the conventional CLM.
Paper Structure (26 sections, 14 equations, 3 figures, 7 tables)

This paper contains 26 sections, 14 equations, 3 figures, 7 tables.

Figures (3)

  • Figure 1: Model illustrations of (a) conventional CLM, (b) simple $N$-gram CLM, and (c) WDR $N$-gram CLM when $N=3$. Note that all of the drawn logit layers above the MLP layers are the same function with the same parameter. Red diagonal lines in (c) on lines from logit layer to $\Delta^r_i\mathbf{x}^{e,l}_t$ indicate detaching operation.
  • Figure 2: From the left-to-right, they are visualizations of the original embeddings (first), 1-level WDR and the plot zoomed in around the original word 'to' (second and third), and 2-level WDR (last), respectively. In the third plot, ('to-word') means the 1-level WDR vector, that is $\mathbf{x}^{e,l}_{to}-\mathbf{x}^{e,l}_{word}$ based on the word 'to' fragment within the sentence.
  • Figure 3: Gradient diversity comparison between simple 4-gram CLM and WDR 4-gram CLM.