����λ�ã���ҳ > �����̳� > �̳� > ����LLMs�ġ�˼����������Chain-of-Thought(CoT) �����ƶ������������·�չ

����LLMs�ġ�˼����������Chain-of-Thought(CoT) �����ƶ������������·�չ

��Դ������������|��ʱ�䣺2024-06-14 11:49:09 |���Ķ���126��|�� ��ǩ�� T GHT �� S C in AI LMS ���� ug �� |����������

����LLMs�ġ�˼����������Chain-of-Thought(CoT) �����ƶ������������·�չ 1.��� Chain-of-Thought(CoT)��һ�ָĽ���Prompt������Ŀ������������ģ��LLMs�ڸ������������ϵı��֣�������������arithmetic reasoning������ʶ������co

����LLMs�ġ�˼����������Chain-of-Thought(CoT) �����ƶ������������·�չ

1.���

Chain-of-Thought(CoT)��һ�ָĽ���Prompt������Ŀ������������ģ��LLMs�ڸ������������ϵı��֣�������������arithmetic reasoning������ʶ������commonsense reasoning��������������symbolic reasoning����

  • ��Դ ��CoT�����ĸ�������Google�����ġ�Chain-of-Thought Prompting Elicits Reasoning in Large Language Models���б��״������

  • ��״ �����Ŵ�����ģ�ͣ�LLM���ķ�չ��CoT�����ѳ�Ϊ���LLM�ڸ����������������ܵ���Ҫ�ֶΡ�ͨ���ض�����ʾ��prompt����ѵ�����ԣ���������ģ��������ϸ���������̣��Ӷ����ģ�͵�׼ȷ�ԺͿɽ����ԡ�

  • ���� ��CoT����ָ����һ���������̣�����ģ�����������մ�֮ǰ�������Ƶ���һϵ�е��м䲽�����Ŀ�ꡣ��Щ�м䲽�蹹����һ����˼ά��������������ģ�͵õ���ȷ�Ľ����

  • ����˼�� ��ģ��������������̣������������ڽ������ʱ����ֱ�ӵó��𰸣�����ͨ��һϵ�е�˼�����������������衣

  • �ص�������

    1. �м䲽�裺ģ�����������մ�֮ǰ�����Ȳ���һϵ�е��м��������衣
    2. �ɽ����ԣ�����CoT�ṩ���������̵Ŀɼ��ԣ���������������ģ�;��ߵĿɽ����ԡ�
    3. �߼�������CoT���԰���ģ�ͽ��и��ӵ��߼�����������������Ҫ��϶����ʵ����ϢƬ�ε������ϡ�
    4. ���������ã���CoT�У�ģ�Ϳ���������������Ϣ��ͨ����������������⣬�����ǽ���������ֱ�ӵĴ𰸡�
  • ��չ�����Զ�˼ά����Auto-CoT�� ������һ�ָ��߼����CoT������ͨ���òµ¥µï¿½ï¿½ï¿½Ê¾ï¿½ï¿½ï¿½ï¿½Ê¹Ä£ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½Ë¼ï¿½ï¿½ï¿½ï¿½ï¿½Ô¶ï¿½Õ¹Ê¾ï¿½ï¿½ï¿½ï¿½ï¿½Ã·ï¿½ï¿½Ìµï¿½ï¿½â·½ï¿½Ìµï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½Ì¡ï¿½ï¿½ï¿½ï¿½Ö¼ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½Ú±ï¿½Ö¤Ã¿ï¿½ï¿½Ë¼Î¬ï¿½ï¿½ï¿½ï¿½È·ï¿½Ôµï¿½Í¬Ê±ï¿½ï¿½Êµï¿½Ö¸ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½Ê¾ï¿½ï¿½ï¿½ï¿½Æ¡ï¿½

  • ˼·

ICL��˼·�����²��������м���ʾ����demonstration�����ع�prompt����ICL��In-Context Learning��������ͬ��CoT��ÿ��demonstration����ʹ���м��������̣�intermediate reasoning steps�������¹���demonstration��ʹģ���ڶ�������Ԥ��ʱ���������м�������˼ά���������ɽ����Ŀ��������LLM���������еı��֡�

½âËøLLMsµÄ¡°Ë¼¿¼¡±ÄÜÁ¦£ºChain-of-Thought(CoT) ¼¼ÊõÍÆ¶¯¸´ÔÓÍÆÀíµÄз¢Õ¹

2.CoT����

һ����˵CoT���Ϊ���֣������˹�ʾ����ע��Few-shot CoT�����˹�ʾ����ע��Zero-shot CoT�����潫��һ���ܡ�

1.1 Few-shot CoT

�������ICL�IJ������������ʾΪ$$����ô����Few-shot CoT�IJ����������룬�ɱ�ʾΪ$$��

1.1.1 CoT Prompt���

����֪���˼���CoT��ʾ����������LLM�ı��֡���ô����Ӧ����ι����ʹ��CoT��

ͶƱʽCoT

��Self-Consistency Improves Chain of Thought Reasoning in Language Models��

���Ļ���һ��˼�룺һ�����ӵ���������������ж�������·����������˼·�������ն��ܹ��õ���ȷ�Ĵ𰸡���Self-Consistency�ڽ�������У�������greedy decoding�IJ��ԣ�����ʹ�ò����ķ�ʽ��ѡ�����ɲ�ͬ������·����ÿ��·����Ӧһ�����մ𰸡�

����������

  • ���ڵ�һ�IJ������ݣ�ͨ����εĽ�������������ɶ�������·���ʹ𰸡�
  • ����ͶƱ�IJ��ԣ�ѡ����һ�µĴ𰸡�

½âËøLLMsµÄ¡°Ë¼¿¼¡±ÄÜÁ¦£ºChain-of-Thought(CoT) ¼¼ÊõÍÆ¶¯¸´ÔÓÍÆÀíµÄз¢Õ¹

ʵ�����������ͬһ�������ɸ�����������Թ�ͶƱ������ȡ�ø��õ�Ч�����������������㹻��ʱ�����ַ���Ч���ܹ�ʤ��ʹ��greedy decoding��CoT������

��On the advance of making language models better reasoners��

������Self-Consistency�Ļ����ϣ���һ�������Ż���

  • 1.Diverse Prompts
    • ����ÿ���������⣬������$M_1$�ֲ�ͬ��prompt(���ɲ�ͬdemonstration�����prompt)
    • ����ÿ�ֲ�ͬ��prompt����LLM����$M_2$������·����
    • �����ͬһ���������⣬��������$M_1*M_2$�����
  • 2.Verifier
    • ѵ����һ��Verifier�������жϵ�ǰ����·���ó��Ĵ���ȷ���
    • ��������������ʹ��LLM���ɵ�����·���ʹ𰸣���grandtruth���жԱȣ�һ�µļ���Ϊ������������������
  • 3.Vote
    • ѵ����Verifier�󣬶���һ������������LLM���ɵĶ�������·����Verifier���ж�Ԫ�б�
    • ����б�����ͶƱ������ó�ģ�͵�����Ԥ�⡣

½âËøLLMsµÄ¡°Ë¼¿¼¡±ÄÜÁ¦£ºChain-of-Thought(CoT) ¼¼ÊõÍÆ¶¯¸´ÔÓÍÆÀíµÄз¢Õ¹

ʵ������ʾ�������ĵķ�����Ի���Greedy Decode��Self-Consistency�ܵõ����ŵ�Ч����

ʹ�ø��ӵ�CoT

��Complexity-based prompting for multi-step reasoning��

�����ô���ѡ��CoT���򵥵�CoTʾ���͸��ӵ�CoTʾ�������µ�������������᲻�����Ӱ�죿����Yes��

����̽����һ�����⣬�ڰ���������·����demonstrations�͸�������·����demonstrations�£��ĸ�Ч������ֽϺã�������ļ򵥺͸�����ָ ������/��������ij��ȣ�

�����ļ̳���Self-Consistency��˼�룬���巽����

  • 1.����ͬһ���������⣬ʹ�ù���LLM��GPT-3������$N$����ͬ��������+�𰸣�
  • 2.�������ɵ�������+�𰸣������������ij��Ƚ��е�������
  • 3.����TopK��������+�𰸣���ʹ��ͶƱ�ķ�ʽ��ѡȡ����Ԥ�⡣

ʵ���������������ĵķ���Ч���������·����� (1)�˹�����Cot��(2)random Cot��(2)Complex CoT�����ݼ�����Ķ��˼ά����Ϊdemonstrations����

½âËøLLMsµÄ¡°Ë¼¿¼¡±ÄÜÁ¦£ºChain-of-Thought(CoT) ¼¼ÊõÍÆ¶¯¸´ÔÓÍÆÀíµÄз¢Õ¹

�Զ�����CoT

��Automatic chain of thought prompting in large language models��

�����ᵽ�ķ����ǻ����˹�����CoT���������ܷ���ģ���Լ�������CoT�������ľ��ṩ������һ���Զ�����CoT��˼·��

�������ᵽ��Manual-CoT�����Ե�ͬ��Few-shot CoT�����⡣

½âËøLLMsµÄ¡°Ë¼¿¼¡±ÄÜÁ¦£ºChain-of-Thought(CoT) ¼¼ÊõÍÆ¶¯¸´ÔÓÍÆÀíµÄз¢Õ¹

����Zero-Shot-CoT�������ڲ��ȶ��ԣ���Manual-CoT������Ҫ�����˹��ɱ�Ͷ�롣���������һ�ֻ���Auto-CoT�ķ������Զ����������������������˵������(demonstrations)��

�������̷��������׶Σ�

1.question cluster: Ŀ���ǽ����ݼ��е�question���ֵ���ͬ���С�

  • ʹ��Sentence-Bert����ÿ��question��������ʾ��
  • ʹ��k-means������question���Դػ��֣�
  • ����ÿ�����е�question�����ݾ������ĵ���룬��������

2.demostration sampling: Ŀ���Ǵ�ÿ������ѡȡһ�������Ե�question������LLMs��ʹ��Zero-Shot-CoT������������

  • ����ÿһ����$i$���ÿһ������$q {(i)}_j$��ʹ��Zero-Shot-CoT�������$[Q:q _j,A:[P]]$������$[P]$��ʾ"Let's think step by step"�����뵽LLMs��LLMs���ɸ������������$r {(i)}_j$�ʹ�$a _j$��

  • ������$q {(i)}_j$������60��tokens����������$r _j$������5���������裬������+������+�𰸣����뵽demostrations���:$[Q:q {(i)}_j,A:r _j��a^{(i)}_j]$��

  • ���������дأ����õ�k��demostrations������ƴ���ϲ���question��������µ�Prompt������LLMs��ɵõ����ɽ����

ֵ��һ����ǣ�Auto-CoT�ڶ����Դ������������ݼ��ϣ�Ч����Manual-CoT�൱������ijЩ������ֵø��á�

½âËøLLMsµÄ¡°Ë¼¿¼¡±ÄÜÁ¦£ºChain-of-Thought(CoT) ¼¼ÊõÍÆ¶¯¸´ÔÓÍÆÀíµÄз¢Õ¹

CoT��ʾ��˳���Ӱ��

��Chain of thought prompting elicits reasoning in large language models��

����CoT��ICL��һ��������ʽ��������ICL������ͬ���ǣ�CoT��demonstrations������������²��������е����ɽ��Ӱ���С�����Ķ�demonstrations�����������ڶ������������Ͻ�����С��2%�����ܱ仯����demonstrations˳���ICLӰ��ϴ�

1.1.2 CoT����ǿ����

COT��Chain-of-Thought������ǿ������Ҫ�������¼��֣�

  1. �����֤��ϸ����

    • ˼ά�����������п��ܻ����������������������衣Ϊ�˼����������󣬿��Խ����֤����ȡ�����������ݷ����Ľ��������̡���������ķ�˼�������ơ�
    • ���磬VerifyCoT�����һ����Ȼ����NaturalProgram��������ģ�Ͳ�����ȷ���������裬ÿ���������趼�ϸ����֮ǰ�IJ��衣
  2. ����ֽ⣺

    • COTͨ�����ಽ����������ֽ�ɶ���м䲽�裬���������ļ����������ɸ����token���ٽ�����⡣���ֲ��������ڸ��õ����������ÿ�����֡�
  3. �����ⲿ֪ʶ��

    • ��ijЩ����£�Ϊ�˴ٽ�֪ʶ�ܼ������ñ£¬¿ï¿½ï¿½Ô½ï¿½ï¿½ï¿½â²¿ÖªÊ¶ï¿½Ô²ï¿½È·ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½Ó½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½Ó¶ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½Ù·ï¿½ï¿½ï¿½ï¿½Ðµï¿½ï¿½ï¿½Êµï¿½ï¿½ï¿½ï¿½
  4. ͶƱ����

    • DIVERSE�Ȳ�������ͶƱ������������𰸣�Ȼ���ÿ������������ж�����ϸ������֤���Ӷ����������׼ȷ�ԡ�
  5. ���Ч�ʣ�

    • ͨ���Ż�ģ�ͽṹ���㷨�����ٲ���Ҫ�ļ����������������Ч�ʡ�
  6. ƫ����ǿһ����ѵ����BCT����

    • ���COT���ܲ�����ϵͳ��ƫ�����⣬������BCT�޼ල΢�����������ַ�������ѵ��ģ���ڰ����Ͳ�����ƫ����������ʾ�¸���һ�µ�����������ƫ��������ʵ�������BCT������������ƫ�������ʣ����ģ�ͽ��͵Ŀ��Ŷȡ�
  7. Zero-shot-COT��

    • ������һ�ּòµ¥µï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½Ê¾ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½Í¨ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½Ä½ï¿½Î²ï¿½ï¿½ï¿½Ó¡ï¿½Let's think step by step���ȴ��ʹ������ģ���ܹ�����һ���ش������˼ά�������ַ�����������ѵ�����ݣ�����ֱ��Ӧ���ڸ�����������

1.2 Zero-shot CoT

��Few-shot CoT��ͬ��Zero-shot CoT������Ҫ��Ϊ����demonstrations��ֻ��Ҫ��prompt�м���һ���ض���ָ���������LLMs��˼ά���ķ�ʽ���ɽ����

��Ȼ���ֲ���Ҫ�˹�����demonstrations�ķ�ʽ��Ч�����Few-shot CoT�������΢��һ��㡣�������Zero-shot��Few-shot�ķ������ԣ�Zero-shot CoT�ڸ�������������ȴ�ܴ����޴��Ч��������

½âËøLLMsµÄ¡°Ë¼¿¼¡±ÄÜÁ¦£ºChain-of-Thought(CoT) ¼¼ÊõÍÆ¶¯¸´ÔÓÍÆÀíµÄз¢Õ¹

��Large language models are zero-shot reasoners��

�������������Zero-shot CoT�ķ������������̰��������֣�

  • 1.Reasoning Extraction
    • ʹ��һ���ض���"reasoning" prompt���������LLM����ԭʼ�����˼ά������"Let's think step by step."��������һ������˼����
  • 2.Answer Extraction
    • ���ڵ�һ���Ľ��������һ��"answer" prompt��Ҫ��LLM������ȷ�Ľ����
    • ��һ�������У�LLM�������ʽΪ��quesiton + "reasoning" prompt + result(CoT) + "answer" prompt�������result(answer)

ֵ��һ����ǣ�����ͬʱ�����ˣ���ģ��LLM���Խ��Խ�󣬶���ʹ��Zero-shot�Ľ�����������治�󣬵��Ƕ�ʹ��Zero-shot CoT�Ľ������������ϴ�

½âËøLLMsµÄ¡°Ë¼¿¼¡±ÄÜÁ¦£ºChain-of-Thought(CoT) ¼¼ÊõÍÆ¶¯¸´ÔÓÍÆÀíµÄз¢Õ¹

��Scaling Instruction-Finetuned Language Models��

��Ȼ����һƪ�����У��Ѿ�������LLM����Zero-shot CoT����������������ȶ�LLM���л���CoT��instruction tuning����ģ��ʹ��Zero-shot CoT��ʽ�ڶ�unseen��������Ԥ��ʱ��Ч���᲻����ã������ĸ����˿϶��Ĵ𰸡�

����̽�������¿���Ӱ��LLM��unseen task�ϱ��ֵ����أ�

  • 1.��������
  • 2.ģ�ʹ�С
  • 3.ָ��΢����instruction tuning��

����΢�����ݼ�������1836��ָ������473�����ݼ���146���������͹��ɣ����ݼ��а�����9���˹���ע��CoT���ݼ���ͬʱ����һ��û���ֹ���held-out���ݼ���Ϊģ���������ݼ���

½âËøLLMsµÄ¡°Ë¼¿¼¡±ÄÜÁ¦£ºChain-of-Thought(CoT) ¼¼ÊõÍÆ¶¯¸´ÔÓÍÆÀíµÄз¢Õ¹

½âËøLLMsµÄ¡°Ë¼¿¼¡±ÄÜÁ¦£ºChain-of-Thought(CoT) ¼¼ÊõÍÆ¶¯¸´ÔÓÍÆÀíµÄз¢Õ¹

ʹ�õ�ģ����PaLM��������instruction tuning��ģ�ͣ���ΪFlanPaLM��Finetuned Language PaLM����

�õ������½��ۣ�

  • 1.����΢�������������������LLM���֡���������������һ��ֵ�󣬲���ģ�ͳߴ��Ƿ��������涼�����Ʋ�ԭ���У�
    • (1) �����������������㣬û��ΪLLM�ṩ�µ�֪ʶ��
    • (2) ������ָ��΢��ֻ�Ǹ��õؼ�����ģ�ʹ�Ԥѵ��������ѧϰ��֪ʶ�ı�����������΢�����ñ³¬¹ï¿½Ò»ï¿½ï¿½Öµï¿½ó£¬¶Ô±ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½Ã»ï¿½ï¿½Ì«ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½
  • 2.΢����δ΢����PaLM����8B����540B����unseen������Ч��Խ��Խ�ã�
  • 3.΢��������CoT���ݵĹ�ϵ
    • (1) ΢��������ɾ��CoT���ݣ��ή��PaLM����������
    • (2) ΢�����ݰ���CoT���ݣ���ȫ�����������������ı���

3.�ܽ�

���ڴ�ģ��LLMӿ�ֵ�CoT������ҵ��Ŀǰ�Ĺ�ʶ�ǣ���ģ�Ͳ�������100B���ڸ�������������ʹ��CoT���ܴ�������ģ�����ģ��С������ߴ磬CoT���������Ч�����档

���ǵ���Pretrain+Fine-tuningʱ���£����ڸ�����ѧ����������MultiArith��GSM8K�£�Ч�����Dz�̫���룬���̶̼���ʱ�䣬LLM+CoT��ģʽ�Ѿ���������˸�����Ľ������������LLM�ļ�����չ��δ���ض��ᷢ�ָ���LLM���ص�������ʹ�÷�������������Ŀ�Դ���

4.Reference

Chain-of-Thought Prompting Elicits Reasoning in Large Language Models

Large language models are zero-shot reasoners

Scaling Instruction-Finetuned Language Models

Self-Consistency Improves Chain of Thought Reasoning in Language Models

On the advance of making language models better reasoners

Chain of thought prompting elicits reasoning in large language models

Complexity-based prompting for multi-step reasoning

Chain of thought prompting elicits reasoning in large language models

���������������ע���ţ�͡ؼ�˹����ܣ����ṩһЩ��ص���Դ���������£���ѻ�ȡ�Ķ���

С���Ƽ��Ķ�

�������������Ľ�Ϊ������Ϣ����������������ͬ���޹۵��֤ʵ��������

Ëø
��
���ͣ���������������Ӫ״̬����ʽ��Ӫ�������ԣ����� ����

��Ϸ����

��Ϸ���

��Ϸ��Ƶ

��Ϸ����

��Ϸ�

��������LOCK������Ϸ��RixelStudio������һ���򵥵�������Ϸ����������������ġ���Ȼ�����Ϸ���ü���

�����Ƶ����

����

ͬ������

����

ɨ��ά�����������ֻ��汾��

ɨ��ά����������΢�Ź��ںţ�

��վ�������������������ϴ��������ַ���İ�Ȩ���뷢�ʼ�[email protected]

��ICP��2022002427��-10 �湫��������43070202000427��© 2013~2025 haote.com ������