Chain of Code — AI Glossary

Chain of Code is a hybrid reasoning pattern in which the model produces a trace that interleaves executable code with natural-language "pseudocode" comments. The code sections are run by an interpreter; the natural-language sections are "executed" by the model itself acting as a simulator, substituting plausible outputs for steps that cannot be expressed as code. Introduced by Li et al.