{"id":19520151,"url":"https://github.com/osu-nlp-group/deductive-beam-search","last_synced_at":"2025-04-26T07:31:32.253Z","repository":{"id":220088775,"uuid":"749275500","full_name":"OSU-NLP-Group/Deductive-Beam-Search","owner":"OSU-NLP-Group","description":"[COLM'24] \"Deductive Beam Search: Decoding Deducible Rationale for Chain-of-Thought Reasoning\"","archived":false,"fork":false,"pushed_at":"2024-06-14T15:04:07.000Z","size":35,"stargazers_count":20,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-04T10:03:28.634Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OSU-NLP-Group.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-28T04:37:07.000Z","updated_at":"2025-03-09T10:29:41.000Z","dependencies_parsed_at":"2024-06-14T16:40:11.798Z","dependency_job_id":null,"html_url":"https://github.com/OSU-NLP-Group/Deductive-Beam-Search","commit_stats":null,"previous_names":["osu-nlp-group/deductive-beam-search"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSU-NLP-Group%2FDeductive-Beam-Search","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSU-NLP-Group%2FDeductive-Beam-Search/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSU-NLP-Group%2FDeductive-Beam-Search/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSU-NLP-Group%2FDeductive-Beam-Search/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OSU-NLP-Group","download_url":"https://codeload.github.com/OSU-NLP-Group/Deductive-Beam-Search/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250953585,"owners_count":21513394,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T00:24:04.472Z","updated_at":"2025-04-26T07:31:30.285Z","avatar_url":"https://github.com/OSU-NLP-Group.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eDeductive Beam Search\u003cbr\u003eDecoding Deducible Rationale for Chain-of-Thought Reasoning \u003c/h1\u003e\n\n![Static Badge](https://img.shields.io/badge/task-reasoning-purple)\n\u003c!-- ![GitHub Repo stars](https://img.shields.io/github/stars/OSU-NLP-Group/Deductive-Beam-Search) --\u003e\n\nSource Code of paper [`Deductive Beam Search: Decoding Deducible Rationale for Chain-of-Thought Reasoning`](https://arxiv.org/abs/2401.17686).\n\n# Quick Start\nClone repo:\n```bash\ngit clone https://github.com/OSU-NLP-Group/Deductive-Beam-Search.git\ncd Deductive-Beam-Search\nmkdir outputs\n```\n\nInstall requirements:\n```bash\nconda create --name dbs python=3.10\nconda activate dbs\npip install -r requirements.txt\n```\n\nTraining:\n\n- Stage 1:\n\n  ```bash\n  python src/train.py \\\n      --train_datapath your_data_path_stage1 \\\n      --experiment_name your_experiment_name_stage1 \\\n      --batch_size 8 --gradient_accumulation_steps 16 \\\n      --learning_rate 1e-5\n  ```\n\n- Stage 2:\n\n  ```bash\n  python src/train.py \\\n      --train_datapath your_data_path_stage2 \\\n      --experiment_name your_experiment_name_stage2 \\\n      --batch_size 8 --gradient_accumulation_steps 16 \\\n      --learning_rate 1e-7\n  ```\n\nInference:\n```bash\nDECODER_PATH=your_model_path\nDATASETS=(\"gsm8k\" \"svamp\") # add datasets you want to test\n\nfor TEST_DATASET in ${DATASETS[@]};\ndo\n    python src/test.py \\\n        --test_dataset $TEST_DATASET \\\n        --output_dir outputs/$TEST_DATASET \\\n        --decoder_path $DECODER_PATH \\\n        --decode_strategy beam_search \\\n        --num_beams 5 \\\n        --num_sampling 10 \\\n        --num_gpus_decode 4 # how many gpus for inference\ndone\n```\n\n# Data\n\n## Training Data\n\nAll training data synthesized is in `data/` folder. The training file `data/stage1/train.json` is used for training a general deductive verifier. For stage 2, the arithmetic and symbolic verifier is trained on `data/stage2/arithmetic/train.split.*.json`, and the commonsense verifier is trained on `data/stage2/commonsense/train.json`.\n\n## Checkpoints\n\nWe provide the checkpoint of a general deductive verifier, please download from this [link](https://drive.google.com/drive/folders/1GbnAiX160Cz63zAbr2FAgB0QFySfM2Vn?usp=sharing).\nYou can use it to continue-train on our data or train on your own data.\n\n## Data Generation\nThe complete process of data construction is in `src/generate_data.py`.\nIf you want to generate data on your own, please modify the data loading part.\nAfter modifying, you can run `python src/generate_data.py` to generate data for your own domains.\n\n**\\[TODO\\]** We will improve the code for easier modification and usage.\n\n# Contact\n\nIf you have any problems, please contact \n[Tinghui Zhu](mailto:darthzhu@gmail.com) and\n[Kai Zhang](mailto:zhang.13253@osu.edu).\n\n# Citation Information\n\nIf you find our codes and data useful, please consider citing our paper:\n\n```\n@article{zhu2024deductive,\n  title={Deductive Beam Search: Decoding Deducible Rationale for Chain-of-Thought Reasoning},\n  author={Zhu, Tinghui and Zhang, Kai and Xie, Jian and Su, Yu},\n  journal={arXiv preprint arXiv:2401.17686},\n  year={2024}\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosu-nlp-group%2Fdeductive-beam-search","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosu-nlp-group%2Fdeductive-beam-search","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosu-nlp-group%2Fdeductive-beam-search/lists"}