Skip to content

cot-prompting: make the standard-vs-CoT contrast real again on current models - #59

Merged
NirDiamant merged 1 commit into
mainfrom
fix/2026-10-31-wave2
Oct 31, 2026
Merged

NirDiamant merged 1 commit into
mainfrom
fix/2026-10-31-wave2

Conversation

@NirDiamant

@NirDiamant NirDiamant commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

What this fixes

cot-prompting.ipynb is meant to show that Chain of Thought beats a standard prompt on multi-step problems. On current models the standard prompt ("Answer the following question concisely") no longer suppresses reasoning: in 4 of 4 probe calls on gpt-5.4-mini it wrote out the tank volume, the remaining third and the conversion anyway (about 200 output tokens each). Both prompts were doing chain of thought, so the contrast was gone.

Changes (1 notebook)

  • Baseline prompt now reads: "Answer the following question. Reply with only the final answer, no explanation: {question}". The CoT prompts are unchanged.
  • temperature=0 on the gpt-5.4-mini model, so the run is repeatable. GPT-5.x accepts a non-default temperature only with reasoning_effort="none" (verified: with reasoning_effort="low" the API returns 400 for temperature 0), which this notebook already sets.
  • Outputs refreshed from a real top-to-bottom run. The old outputs were from an earlier model.
  • Markdown now matches the run:
    • a note that "concisely" is not enough on current models, and why "final answer only" is the fair baseline;
    • after the train question: both prompts give 60 km/h, CoT only shows its work;
    • after the water-tank problem: the standard prompt answered 1 hour 15 minutes, CoT answered 15 hours 42 minutes, which is correct (1/3 x pi x 1.5^2 x 4 = 9.42 m3 = 9,425 L, at 10 L/min = 942 min), plus why CoT helps and how reasoning models relate to it.

The water-tank problem still shows the contrast, so no problem was swapped.

Verification

  • Run for real: the whole notebook, top to bottom, with nbclient (gpt-5.4-mini with reasoning_effort="none", and gpt-5.4 for the logic puzzle). The logic puzzle resolved correctly (Amy liar, Bob truth-teller, Charlie alternator). Before editing, I probed the water-tank problem 4 times per prompt at temperature 0: "concisely" always reasoned on the page, and "final answer only" always answered 1 hour 15 minutes.
  • Parsed: the repo's smoke check (compile every notebook) passes locally on this branch, 22 notebooks.
  • API spend: under $0.10.

Left for Nir

🤖 Generated with Claude Code


PR Summary by Qodo

Restore the standard-versus-CoT contrast in the prompting notebook

🐞 Bug fix 📝 Documentation 🕐 10-20 Minutes


AI Description

• Require final-answer-only baseline responses so current models do not show reasoning in both
 examples.
• Set temperature to zero, rerun the notebook, and refresh its saved outputs.
• Explain why both prompts solve the train question but only CoT solves the tank problem.
Diagram

graph TD
  Q["Example question"] --> B["Final-only prompt"] --> M("Mini model") --> O["Saved comparison"]
  Q --> C["Step-by-step prompt"] --> M
Loading
High-Level Assessment

Keep the prompt-only baseline and unchanged CoT prompts: they preserve the notebook's existing questions while making the visible-reasoning difference clear. A token cap or a replacement problem would introduce another variable into the comparison. Treat the tank answers as results of the recorded run, not a guarantee of future model behavior.

Files changed (1) +524 / -61

Bug fix (1) +524 / -61
cot-prompting.ipynbRestore and explain the final-only baseline versus CoT comparison +524/-61

Restore and explain the final-only baseline versus CoT comparison

• Changes the standard prompt to request only the final answer and sets temperature to zero for gpt-5.4-mini. Refreshes outputs from a top-to-bottom run, including the logic puzzle, and adds markdown explaining the matching train answers and the divergent tank answers.

all_prompt_engineering_techniques/cot-prompting.ipynb

Summary by CodeRabbit

  • Documentation
    • Updated the notebook to compare standard and chain-of-thought responses, with a worked tank example concluding at 15 hours 42 minutes.
    • Added a detailed explanation of the logic puzzle and a summary of the tank example’s reasoning.

… contrast shows again

On current models "answer concisely" no longer stops the model from writing out
its steps, so the standard prompt was quietly doing chain of thought too. The
baseline now says "Reply with only the final answer, no explanation". The
notebook was re-run on gpt-5.4-mini with reasoning_effort="none" and
temperature=0, and the new markdown describes what that run shows: on the
water-tank problem the baseline answers 1 hour 15 minutes (wrong) and the CoT
prompt answers 15 hours 42 minutes (right).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4031e2b7-328c-43a5-8f16-a7ace739ee26
Commits

Reviewing files that changed from the base of the PR and between 4b2d7d0 and c0a18b0.

Files selected for processing: 1
  • all_prompt_engineering_techniques/cot-prompting.ipynb

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Walkthrough

The notebook updates its shared model configuration, standard and CoT prompts, example outputs, and explanations. It also records a detailed logic-puzzle output.

Changes: CoT prompting examples

Layer / File(s) Summary
Model setup and basic prompt example
all_prompt_engineering_techniques/cot-prompting.ipynb
The setup adds temperature=0 alongside reasoning_effort="none". The basic example uses a final-answer-only standard prompt and contrasts it with the CoT prompt.
Calculation examples and comparison
all_prompt_engineering_techniques/cot-prompting.ipynb
The advanced example records a five-step average-speed calculation. The tank example records standard and CoT answers, followed by an explanation of their difference.
Logic-puzzle output
all_prompt_engineering_techniques/cot-prompting.ipynb
The cell records the role assignments, eliminated cases, and conclusion for the logic puzzle.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Suggested reviewers: adornes

Merge Risk: Minimal · up to c0a18

The updated notebook has no identified merge-blocking issue.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title is in the right area: it names the notebook (cot-prompting) and the goal of restoring a standard-vs-CoT contrast on current models. The diff does show that contrast change: the baseline prom…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title is in the right area: it names the notebook (cot-prompting) and the goal of restoring a standard-vs-CoT contrast on current models. The diff does show that contrast change: the baseline prompt now asks for only the final answer, and the notebook sets temperature=0 and reasoning_effort="none" for gpt-5.4-mini. The title is specific and short, and it names the main change. It is a single sentence of 10 words and avoids vague terms. Its wording is a little informal ("make ... real again"), but a teammate scanning history would understand the primary change.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Great, no issues found!

Qodo reviewed your code and found no material issues that require review
Tip of the day
💡 Did you know, you can keep summaries lean with Findings visible per group, which tucks the rest behind a View link

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗


Powered by Qodo

@NirDiamant
NirDiamant merged commit cf39464 into main Oct 31, 2026
3 checks passed
@NirDiamant
NirDiamant deleted the fix/2026-10-31-wave2 branch October 31, 2026 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant