BWArea Model: Learning World Model, Inverse Dynamics, and Policy for Controllable Language Generation

Chengxing Jia, Pengyuan Wang, Ziniu Li, Yi-Chen Li, Zhilong Zhang, Nan Tang, Yang YuarXiv 2024 · DOI

Abstract

Traditional Large Language Models (LLMs) operate primarily as next-token predictors, making them difficult to control and sensitive to noisy training data. We present the BWArea model, a novel architecture inspired by the human brain's Broca and Wernicke areas. By decomposing language generation into a language world model, an inverse dynamics model, and a cognitive policy, BWArea achieves superior controllability and enhanced robustness. Our results demonstrate that this structured decision-making approach outperforms standard auto-regressive baselines in complex tasks and maintains performance even when trained on "dirty" data.

Introduction

Standard LLMs generate text auto-regressively, where each token is conditioned solely on the preceding sequence. While powerful, this approach lacks explicit goal-directed planning, leading to a lack of controllability. Aligning these models often requires extensive fine-tuning or complex prompt engineering. Furthermore, the performance of standard LLMs is highly susceptible to "dirty" data—noisy or incorrectly labeled text—during the training phase.

The BWArea model addresses these bottlenecks by reframing language generation as a series of intentional cognitive decisions within a reinforcement learning (RL) framework.

Methods and Architecture

The BWArea architecture draws a direct parallel to the human brain's language centers: Wernicke’s area, responsible for comprehension, and Broca’s area, responsible for generation.

Conceptual framework of the BWArea model inspired by the human brain's language processing centers.

The system is decomposed into three primary components:

  1. Inverse Dynamics Model (The "Comprehender"): Implemented via a VQ-VAE framework, this model analyzes token sequences to infer the "latent action" or intention. It maps high-dimensional language into a discrete, compact action space consisting of 64 codes.
  2. Language World Model (The "Environment"): This component acts as the transition function, predicting the next token based on the previous context and the latent action provided by the policy.
  3. Cognitive Policy (The "Decision Maker"): This high-level planner selects the optimal latent action for a given context to achieve specific objectives.
Detailed architecture of the Inverse Dynamics, Cognitive Policy, and Language World Model components.

Training Workflow

The training process consists of two main phases:

  • Pre-training: The World Model and Inverse Dynamics Model are jointly trained to capture language structure. Subsequently, the Policy is trained using behavior cloning to replicate the intentions identified in the pre-training data.
  • Fine-tuning: The model undergoes Supervised Fine-Tuning (SFT) for instruction following. Finally, Reinforcement Learning (using the ReMax algorithm) optimizes the policy for specific downstream tasks.

Key Insights

Language as Reinforcement Learning

By treating language generation as an RL problem (where State = Context, Action = Latent Intention, and Transition = World Model), the generation process becomes "interferable." This separation allows researchers to adjust the policy's goals without compromising the underlying language world model's understanding of "linguistic physics."

Robustness to "Dirty" Data

A significant finding is the model's inherent robustness. In tests where 10% of training data was replaced with noise, the BWArea model's performance actually improved by 3%, while the TinyLlama baseline suffered a performance drop. This suggests that the decoupled architecture allows the policy to learn to ignore noisy decisions while the world model maintains its grasp on language structure.

Predictive Certainty

Conditioning generation on a latent action significantly reduces predictive variance. The entropy of the BWArea world model was measured at 0.32, a stark contrast to the 2.11 observed in TinyLlama. This indicates that once a high-level "decision" is made, the model is much more certain about the specific tokens required to execute it.

Experimental Results

BWArea was evaluated against TinyLlama (1.1B parameters) across several benchmarks using 30 billion tokens of pre-training data.

  • General Benchmarks: BWArea achieved competitive results on MMLU, DROP, and BigBench Hard (BBH), demonstrating that its complex internal structure does not sacrifice general linguistic capability.
  • Controllability Tasks: On 9 out of 10 tasks across TextWorld and BBH, BWArea outperformed auto-regressive baselines. Notably, in TextWorld's "Custom" and "Dragon" environments, TinyLlama failed to converge entirely (scoring 0), whereas BWArea achieved near-optimal results.
  • Persuasion Capabilities: In a specialized test, BWArea successfully "persuaded" a Llama3-8B model to output a specific target sentence ("the sky is purple"). The baseline model failed this task, eventually generating gibberish.

Conclusion and Future Work

The BWArea model demonstrates that decomposing language generation into comprehension, environment modeling, and policy planning provides significant advantages in controllability and robustness. While currently tested at the 1B parameter scale, future work will explore scaling this architecture to larger models and expanding the latent action space to capture more nuanced semantic intentions. Additionally, extending the "hindsight window" of the inverse dynamics model could allow for even more strategic, long-term planning in language generation.

Summary updated

Abstract

Large language models (LLMs) have catalyzed a paradigm shift in natural language processing, yet their limited controllability poses a significant challenge for downstream applications. We aim to address this by drawing inspiration from the neural mechanisms of the human brain, specifically Broca's and Wernicke's areas, which are crucial for language generation and comprehension, respectively. In particular, Broca's area receives cognitive decision signals from Wernicke's area, treating the language generation as an intricate decision-making process, which differs from the fully auto-regressive language generation of existing LLMs. In a similar vein, our proposed system, the BWArea model, conceptualizes language generation as a decision-making task. This model has three components: a language world model, an inverse dynamics model, and a cognitive policy. Like Wernicke's area, the inverse dynamics model is designed to deduce the underlying cognitive intentions, or latent actions, behind each token. The BWArea model is amenable to both pre-training and fine-tuning like existing LLMs. With 30B clean pre-training tokens, we have trained a BWArea model, which achieves competitive performance with LLMs of equal size (1B parameters). Unlike fully auto-regressive LLMs, its pre-training performance does not degenerate if dirty data unintentionally appears. This shows the advantage of a decomposed structure of BWArea model in reducing efforts in laborious data selection and labeling. Finally, we reveal that the BWArea model offers enhanced controllability via fine-tuning the cognitive policy with downstream reward metrics, thereby facilitating alignment with greater simplicity. On 9 out of 10 tasks from two suites, TextWorld and BigBench Hard, our method shows superior performance to auto-regressive LLMs.
BibTeX
@misc{jia2024bwarea,
  author = {Chengxing Jia and Pengyuan Wang and Ziniu Li and Yi-Chen Li and Zhilong Zhang and Nan Tang and Yang Yu},
  title = {{BWArea Model: Learning World Model, Inverse Dynamics, and Policy for Controllable Language Generation}},
  year = {2024},
  eprint = {2405.17039},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.17039},
}
Figure