Distilling Script Knowledge from Large Language Models for Constrained Language Planning

Siyu Yuan, Jiangjie Chen, Ziquan Fu, Xuyang Ge, Soham Shah, Charles Robert Jankowski, Yanghua Xiao, Deqing Yang

Abstract

Large Language Models (LLMs) demonstrate impressive capabilities in general procedural planning, yet they frequently fail to adhere to specific user-defined constraints. This paper introduces CoScript, a comprehensive dataset of 55,000 constrained scripts, and a novel "over-generate-then-filter" pipeline designed to enhance the faithfulness of language planning. By distilling this knowledge into smaller models, the authors demonstrate that specialized training can enable 3B-parameter models to outperform 175B-parameter counterparts in constrained scenarios.

Introduction

In the context of artificial intelligence, "script knowledge" refers to the ability to decompose a high-level goal (e.g., "make a cake") into a logical sequence of sub-steps. While current LLMs excel at planning for stereotypical, abstract activities, they often struggle with constrained language planning.

Real-world tasks are rarely abstract; they are defined by specific modifiers, methods, or intents. For instance, the steps for "making a cake for a wedding" differ significantly from "making a cake in a microwave." Research indicates that even state-of-the-art models like InstructGPT often produce "unfaithful" scripts—generating fluent, plausible-sounding steps that completely ignore the user's specific constraints. This gap stems from a lack of specialized datasets and the tendency of LLMs to default to the most common (stereotypical) version of a task found in their training data.

The CoScript Framework

The researchers propose a three-step pipeline to improve planning faithfulness and distill that expertise into smaller, more efficient models:

1. Specific Goal Generation

Using in-context learning, the authors prompt an LLM to transform abstract goals (sourced from wikiHow) into specific versions based on three constraint types:

  • Modifier: e.g., "chocolate cake"
  • Method: e.g., "using an oven"
  • Intent: e.g., "for a birthday"

2. Over-generate-then-filter

To ensure the quality of the generated scripts, the system generates $K$ candidate scripts for each goal. A dedicated filter model then selects the most faithful candidate. This filter calculates the semantic similarity between the script and the constrained goal using embeddings (text-embedding-ada-002) and applies a "reward" if the script explicitly contains keywords relevant to the constraint.

3. Symbolic Knowledge Distillation

The high-quality scripts produced by the filtered LLM process are used to fine-tune smaller models, such as T5 and GPT-2. This process effectively distills the planning expertise of a 175B parameter model into models as small as 3B parameters, making sophisticated planning more accessible and efficient.

Data and Benchmarking

The study utilizes three primary datasets:

  • wikiHow: The source for 14,945 "seed" abstract goals.
  • proScript: An existing human-authored goal-oriented script dataset used for benchmarking.
  • CoScript (New): The core contribution of this work, containing 55,000 high-quality scripts across 19 categories (e.g., Health, Food, Business). CoScript features higher lexical diversity and more specific goals per abstract task than previous datasets.

Key Insights

Fluency vs. Faithfulness

LLMs are highly proficient at sounding authoritative, which can mask errors in faithfulness. A script may appear perfect in structure but remain functionally useless if it ignores a critical constraint, such as "no eggs" in a vegan recipe.

The Difficulty of Intent

Models find it significantly easier to handle Method constraints (how to do something) than Intent constraints (why something is being done). Planning for a "diabetic-friendly" goal requires deeper reasoning about prohibited ingredients, whereas "using a microwave" is a more straightforward procedural adjustment.

Performance of Distilled Models

A striking finding of the research is that a 3B parameter T5 model, when trained on the CoScript dataset and augmented with a retrieval system, can outperform a vanilla 175B parameter InstructGPT model on constrained planning tasks. This suggests that for specialized tasks, data quality and specificity are often more critical than raw model size.

Results

  • Accuracy Boost: The "over-generate-then-filter" method improved the planning accuracy of LLMs by 26% compared to standard prompting.
  • Human Evaluation: In manual checks, the proposed method achieved 95% accuracy in generating faithful scripts, compared to only 69% for the baseline InstructGPT (175B).
  • Distillation Success: Smaller models trained on CoScript showed massive improvements. A T5 model trained on wikiHow data achieved only 14% accuracy on constrained tasks, but jumped to 56% (and 71% with retrieval) when trained on CoScript.

Limitations and Future Work

While CoScript represents a significant step forward, several challenges remain:

  • Single Constraints: The current study focuses on goals with one extra constraint. Real-world planning often involves multiple, overlapping constraints (e.g., "make a gluten-free cake in a microwave for a party").
  • Model Bias: As the dataset is distilled from InstructGPT, it may inherit the specific biases or linguistic styles of that model.
  • Execution Gap: There remains a significant gap between generating natural language plans and creating instructions that a robot could execute in a physical environment.
  • Data Noise: Despite rigorous filtering, approximately 5% of the training data may still contain incorrect samples due to the inherent limits of automated generation.

Summary updated

BibTeX
@inproceedings{yuan2023distilling,
  author = {Siyu Yuan and Jiangjie Chen and Ziquan Fu and Xuyang Ge and Soham Shah and Charles Robert Jankowski and Yanghua Xiao and Deqing Yang},
  title = {{Distilling Script Knowledge from Large Language Models for Constrained Language Planning}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.acl-long.236},
}
Figure