self refine
1.0.0
透過 Self-Refine,法學碩士可以產生有關其工作的回饋,用它來改進輸出,並重複此過程。
目錄
斯托克斯定理範例
獨角獸範例
prompt-lib
: git clone https://github.com/reasoning-machines/prompt-lib
pip install prompt-lib/
根據您的預設設置,您可能需要使用以下命令來設定 PYTHONPATH:
export PYTHONPATH= " .:../:.:src:../:../../:.:prompt-lib "
python -u src/acronym/run.py " Using language models of code for few-shot commonsense "
0 INIT > Using language models of code for few - shot commonsense
0 GEN > CLoCK
0 SCORES > * Ease of pronunciation : CLoCK is pronounced " clah-k " . This is easy acronym to pronounce . 4 / 5
* Ease of spelling : CLoCK is easy to spell . 5 / 5
* Relation to title : CLoCK stands for " Code Language Models of Commonsense Knowledge " which is related to the title . 5 / 5
* Positive connotation : CLoCK is a positive acronym . It implies accuracy and efficiency . 5 / 5
* Well - known : CLoCK is not a well - known acronym . 2 / 5
* Total score : 21 / 25
1 GEN > CMNSC
1 SCORES > * Ease of pronunciation : CMNSC is pronounced " see-min-es-see " . This is a difficult acronym to pronounce . 1 / 5
* Ease of spelling : CMNSC is difficult to spell . 1 / 5
* Relation to title : CMNSC stands for " Commonsense " which is related to the title . 4 / 5
* Positive connotation : CMNSC is a neutral acronym . 3 / 5
* Well - known : CMNSC is not a well - known acronym . 1 / 5
* Total score : 10 / 25
2 GEN > COMMIT
2 SCORES > * Ease of pronunciation : COMMIT is pronounced " com-mit " . This is an easy acronym to pronounce . 4 / 5
* Ease of spelling : COMMIT is easy to spell . 5 / 5
* Relation to title : COMMIT stands for " Commonsense Model of Code for Intuitive Training " which is related to the title . 5 / 5
* Positive connotation : COMMIT is a positive acronym . It implies commitment and dedication . 5 / 5
* Well - known : COMMIT is not a well - known acronym . 2 / 5
* Total score : 21 / 25
PYTHONPATH= " . " python -u src/responsegen/run.py --output < OUTPUT FILE > --size < DATA SIZE >
PYTHONPATH= " . " python -u src/readability/readability.py --output < OUTPUT FILE >
PYTHONPATH= " . " python -u src/readability/{count_comment | count_function | count_meaningful_var}.py --file < INPUT FILE >
data/prompt/commongen
中。您可以透過執行以下命令來下載資料: python -u src/commongen/run.py cmd stair bubble team dryer puppy aliens cat
python -u src/gsm/run.py
輸出將保存在data/tasks/gsm/gsm_outputs.jsonl
中
評估輸出:
python src/gsm/gsm_selfref_eval.py --path data/tasks/gsm/gsm_outputs.jsonl
data/tasks/gsm/gsm_outputs.jsonl.reports.txt
),顯示錯誤產生、回饋和細化回饋產生的範例。 python -u src/sentiment_transfer_sr/run.py data/tasks/yelp/yelp-extreme.jso
nl 4 none
data/tasks/yelp/
python -u src/pie/run.py --slow_programs_file data/tasks/pie/codenet-python-test-1k.jsonl --max_attempts 4 --outfile data/tasks/pie/output --feedback_type rich
Init
:用於初始化任務。這就是初始輸出的生成方式。
Feedback
:用於從模型獲取關於中間結果的回饋。
Iterate
:用於根據回饋從模型中取得下一次迭代。
每個任務都有一個run.py
,用於初始化提示並執行任務。
以commongen為例,提示如下:
python src/commongen/task_init.py
python src/commongen/feedback.py
python src/commongen/task_iterate.py
您也可以在我們的網站上看到這些提示。
@misc{madaan2023selfrefine,
title = {Self - Refine: Iterative Refinement with Self - Feedback},
author = {Aman Madaan and Niket Tandon and Prakhar Gupta and Skyler Hallinan and Luyu Gao and Sarah Wiegreffe and Uri Alon and Nouha Dziri and Shrimai Prabhumoye and Yiming Yang and Sean Welleck and Bodhisattwa Prasad Majumder and Shashank Gupta and Amir Yazdanbakhsh and Peter Clark},
year = { 2023 },
eprint = { 2303 . 17651 },
archivePrefix = {arXiv},
primaryClass = { cs . CL }
}
流程圖LR
生成器-->|初始化|粗
Critic_1 --> Critique_fb
... --> Critique_fb
Critic_k --> Critique_fb
Critique_fb --> 未精煉{要精煉的輸出}
未精煉 --> 精煉者
精煉器 --> |R: y_t, x, fb| Refined_Output{精煉輸出}
Refined_Output --> |未符合停止條件|粗