Chain Of Thought Prompting Under Streaming Batch: A Case Study

Yuxin Tang · Submission to Tiny Papers @ ICLR

TL;DR

This paper explores how to optimize Chain-of-Thought (CoT) prompting for Large Language Models (LLMs) in a "streaming" environment where data arrives in batches. The authors discover two counter-intuitive findings: LLMs are surprisingly robust to incorrect reasoning steps in their prompts, and shorter, "shallower" reasoning chains often outperform longer, more complex ones.

The Challenge of Streaming Data

Most methods for automatically generating Chain-of-Thought prompts assume that the entire test dataset is available upfront. In reality, data often arrives in a continuous stream. Previous research suggested updating prompts by simply appending newly generated question-rationale pairs to the existing prompt.

However, this "append-only" strategy hits a wall quickly: LLMs have strict input sequence limits (context windows), and long prompts become redundant and expensive to process. The authors investigate how to select and update these prompts more intelligently by looking at two specific attributes: correctness (do the reasoning steps have to be right?) and depth (how many reasoning steps are actually necessary?).

Experimental Setup

The study focuses on a "streaming batch" setting where a dataset is partitioned into $m$ batches. After each batch is processed by the model (OpenAI’s text-davinci-002), a prompting optimization function updates the prompt for the next batch.

The researchers tested two specific interventions:

  1. Wrong-CoT vs. Correct-CoT: To test the importance of correctness, the authors replaced ground-truth rationales with "Zero-Shot-CoT" rationales that led to incorrect answers, ensuring over 50% of the prompt rationales were wrong.
  2. Shallow-CoT vs. Deep-CoT: To test the importance of depth, the authors defined a heuristic based on the number of newline characters (\n) in a rationale. "Deep" rationales exceeded this threshold, while "Shallow" ones were shorter. The experiment involved replacing lengthier rationales with shorter ones to see if performance held up.

These interventions were evaluated across four diverse datasets covering Arithmetic Reasoning (MultiArith, GSM8K), Commonsense Reasoning (StrategyQA), and Symbolic Reasoning (Last Letter Concatenation). The datasets were manually partitioned into 10 batches each.

Key Insights

  • The "Correctness" Paradox: One of the most surprising findings is that "Wrong-CoT" prompts—where the reasoning steps provided as examples are actually incorrect—do not significantly diminish the model's performance. This suggests that the structure of the reasoning (the fact that the model is being shown how to think) might be more important than the factual accuracy of the examples provided in the prompt.
  • Less is More (Depth): "Shallow-CoT" (shorter reasoning chains) exhibited superior performance compared to "Deep-CoT" (longer, more complex chains). This is a vital insight for prompt engineering: adding more steps to a reasoning chain doesn't necessarily make the model "smarter"; in fact, it might just add noise or consume valuable token space.
  • Efficiency in Streaming: By demonstrating that prompts don't need to be perfectly accurate or exhaustively deep, the paper provides a pathway for more efficient prompt management in production systems where context windows are limited.

Key Results

The results across the datasets consistently supported these insights.

Accuracy comparisons across batches. Left: Correct-CoT vs. Wrong-CoT. Right: Deep-CoT vs. Shallow-CoT.
  • Robustness to Errors: In the arithmetic tasks, the accuracy of "Wrong-CoT" was remarkably close to "Correct-CoT," often staying within a few percentage points across the 10 batches.
  • Shallow Superiority: In almost every batch across the datasets, "Shallow-CoT" matched or exceeded the accuracy of "Deep-CoT." For example, in the MultiArith dataset, Shallow-CoT consistently maintained accuracy in the 85-95% range, frequently outperforming the more complex Deep-CoT examples.

Limitations and Future Work

As a focused case study, this research has a few limitations:

  • Model Specificity: The experiments were conducted exclusively on text-davinci-002. It remains to be seen if more modern models exhibit the same level of robustness to incorrect or shallow prompts.
  • Heuristic Depth: The definition of "depth" was based on a simple newline count. More sophisticated measures of logical complexity could provide deeper insights.
  • Optimization Function: While the paper identifies what makes a good prompt (shallow and potentially even "wrong"), it doesn't propose a fully automated, production-ready algorithm for selecting these prompts in real-time. Future work could focus on automating the selection of these "efficient" rationales.

Summary updated

BibTeX
@misc{tang2023chain,
  author = {Yuxin Tang},
  title = {{Chain Of Thought Prompting Under Streaming Batch: A Case Study}},
  year = {2023},
  eprint = {2306.00550},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2306.00550},
}
Figure