[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-google-deepmind--alphageometry":3,"tool-google-deepmind--alphageometry":65},[4,17,27,35,48,57],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",151314,2,"2026-04-11T23:32:58",[13,14,15],"开发框架","Agent","语言模型","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,3,"2026-04-06T11:19:32",[15,26,14,13],"图像",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":10,"last_commit_at":33,"category_tags":34,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":10,"last_commit_at":41,"category_tags":42,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",85092,"2026-04-10T11:13:16",[26,43,44,45,14,46,15,13,47],"数据工具","视频","插件","其他","音频",{"id":49,"name":50,"github_repo":51,"description_zh":52,"stars":53,"difficulty_score":54,"last_commit_at":55,"category_tags":56,"status":16},5784,"funNLP","fighting41love\u002FfunNLP","funNLP 是一个专为中文自然语言处理（NLP）打造的超级资源库，被誉为\"NLP 民工的乐园”。它并非单一的软件工具，而是一个汇集了海量开源项目、数据集、预训练模型和实用代码的综合性平台。\n\n面对中文 NLP 领域资源分散、入门门槛高以及特定场景数据匮乏的痛点，funNLP 提供了“一站式”解决方案。这里不仅涵盖了分词、命名实体识别、情感分析、文本摘要等基础任务的标准工具，还独特地收录了丰富的垂直领域资源，如法律、医疗、金融行业的专用词库与数据集，甚至包含古诗词生成、歌词创作等趣味应用。其核心亮点在于极高的全面性与实用性，从基础的字典词典到前沿的 BERT、GPT-2 模型代码，再到高质量的标注数据和竞赛方案，应有尽有。\n\n无论是刚刚踏入 NLP 领域的学生、需要快速验证想法的算法工程师，还是从事人工智能研究的学者，都能在这里找到急需的“武器弹药”。对于开发者而言，它能大幅减少寻找数据和复现模型的时间；对于研究者，它提供了丰富的基准测试资源和前沿技术参考。funNLP 以开放共享的精神，极大地降低了中文自然语言处理的开发与研究成本，是中文 AI 社区不可或缺的宝藏仓库。",79857,1,"2026-04-08T20:11:31",[15,43,46],{"id":58,"name":59,"github_repo":60,"description_zh":61,"stars":62,"difficulty_score":54,"last_commit_at":63,"category_tags":64,"status":16},5773,"cs-video-courses","Developer-Y\u002Fcs-video-courses","cs-video-courses 是一个精心整理的计算机科学视频课程清单，旨在为自学者提供系统化的学习路径。它汇集了全球知名高校（如加州大学伯克利分校、新南威尔士大学等）的完整课程录像，涵盖从编程基础、数据结构与算法，到操作系统、分布式系统、数据库等核心领域，并深入延伸至人工智能、机器学习、量子计算及区块链等前沿方向。\n\n面对网络上零散且质量参差不齐的教学资源，cs-video-courses 解决了学习者难以找到成体系、高难度大学级别课程的痛点。该项目严格筛选内容，仅收录真正的大学层级课程，排除了碎片化的简短教程或商业广告，确保用户能接触到严谨的学术内容。\n\n这份清单特别适合希望夯实计算机基础的开发者、需要补充特定领域知识的研究人员，以及渴望像在校生一样系统学习计算机科学的自学者。其独特的技术亮点在于分类极其详尽，不仅包含传统的软件工程与网络安全，还细分了生成式 AI、大语言模型、计算生物学等新兴学科，并直接链接至官方视频播放列表，让用户能一站式获取高质量的教育资源，免费享受世界顶尖大学的课堂体验。",79792,"2026-04-08T22:03:59",[46,26,43,13],{"id":66,"github_repo":67,"name":68,"description_en":69,"description_zh":70,"ai_summary_zh":70,"readme_en":71,"readme_zh":72,"quickstart_zh":73,"use_case_zh":74,"hero_image_url":75,"owner_login":76,"owner_name":77,"owner_avatar_url":78,"owner_bio":79,"owner_company":69,"owner_location":69,"owner_email":69,"owner_twitter":69,"owner_website":80,"owner_url":81,"languages":82,"stars":90,"forks":91,"last_commit_at":92,"license":93,"difficulty_score":94,"env_os":95,"env_gpu":96,"env_ram":97,"env_deps":98,"category_tags":106,"github_topics":69,"view_count":10,"oss_zip_url":69,"oss_zip_packed_at":69,"status":16,"created_at":107,"updated_at":108,"faqs":109,"releases":140},6753,"google-deepmind\u002Falphageometry","alphageometry",null,"AlphaGeometry 是一款由 Google DeepMind 开发的开源几何定理证明系统，旨在无需依赖人类解题示范的情况下，自动解决奥林匹克级别的复杂几何难题。它成功攻克了传统 AI 在需要深度逻辑推理与构造辅助线场景下的瓶颈，实现了接近金牌选手的解题水平。\n\n该工具的核心创新在于采用了“神经语言模型”与“符号演绎引擎”双系统协同架构。语言模型负责像人类直觉一样预测并生成关键的辅助几何元素，而符号引擎则基于严格的逻辑规则进行推导验证。这种神经与符号相结合的方法，既保留了深度学习的泛化能力，又确保了数学证明的严谨性。\n\nAlphaGeometry 主要面向人工智能研究人员、数学教育者以及对自动推理感兴趣的开发者。对于研究者而言，它提供了复现顶级学术论文成果的完整代码与预训练权重，是探索神经符号 AI 前沿的理想平台；对于教育领域，它能作为强大的辅助工具生成新颖的几何题目与解法。虽然运行完整性能需要一定的计算资源，但其模块化设计也允许用户在轻量级配置下体验核心的逻辑推导过程，是连接抽象数学推理与现代深度学习技术的重要桥梁。","\n# Solving Olympiad Geometry without Human Demonstrations\n\n\nThis repository contains the code necessary to\nreproduce DDAR and AlphaGeometry,\nthe two geometry theorem provers\nintroduced in the [Nature 2024](https:\u002F\u002Fwww.nature.com\u002Farticles\u002Fs41586-023-06747-5) paper:\n\n*\u003Ccenter>\"Solving Olympiad Geometry without Human Demonstrations\".\u003C\u002Fcenter>*\n\n\n\u003C\u002Fbr>\n\n\n\u003Ccenter>\n\u003Cimg alt=\"fig1\" width=\"800px\" src=\"fig1.svg\">\n\u003C\u002Fcenter>\n\n**Update (Jan 2026):** AlphaGeometry2 is [published](https:\u002F\u002Fjmlr.org\u002Fpapers\u002Fv26\u002F25-1654.html), its code for DDAR is released at [alphageometry2](https:\u002F\u002Fgithub.com\u002Fgoogle-deepmind\u002Falphageometry2).\n\n\n## Dependencies\n\nFor the instructions presented below,\nwe use Python 3.10.9, and dependencies with their exact\nversion numbers listed in `requirements.txt`.\n\nOur code depends on `meliad`, which is\nnot a registered package with `pip`. See instructions below\nfor how to manually install `meliad`.\n\nNote that one can still run the DDAR solver\nwithout the `meliad` and `sentencepiece` dependencies.\n\n## Run the instructions\n\nAll instructions in this `README.md` can be run in one go by:\n\n```\nbash run.sh\n```\n\nBelow, we explain these instructions step-by-step.\n\n## Install dependencies, download weights and vocabulary.\n\nInstallation is done in a virtual environment:\n\n```\nvirtualenv -p python3 .\nsource .\u002Fbin\u002Factivate\npip install --require-hashes -r requirements.txt\n```\n\nDownload weights and vocabulary:\n\n```\nbash download.sh\nDATA=ag_ckpt_vocab\n```\n\nFinally, install `meliad` separately as it is not\nregistered with `pip`:\n\n```\nMELIAD_PATH=meliad_lib\u002Fmeliad\nmkdir -p $MELIAD_PATH\ngit clone https:\u002F\u002Fgithub.com\u002Fgoogle-research\u002Fmeliad $MELIAD_PATH\nexport PYTHONPATH=$PYTHONPATH:$MELIAD_PATH\n```\n\n## Set up common flags\n\nBefore running the python scripts,\nlet us first prepare some commonly used flags.\nThe symbolic engine needs definitions and deduction rules to operate.\nThese definitions and rules are provided in two text files\n`defs.txt` and `rules.txt`.\n\n```shell\nDDAR_ARGS=(\n  --defs_file=$(pwd)\u002Fdefs.txt \\\n  --rules_file=$(pwd)\u002Frules.txt \\\n);\n```\n\nNext, we define the flags relevant to the proof search.\nTo reproduce the simple examples below,\nwe use lightweight values for the proof search parameters:\n\n```shell\nBATCH_SIZE=2\nBEAM_SIZE=2\nDEPTH=2\n\nSEARCH_ARGS=(\n  --beam_size=$BEAM_SIZE\n  --search_depth=$DEPTH\n)\n```\n\nNOTE: The results in our paper can be obtained by setting\n`BATCH_SIZE=32`, `BEAM_SIZE=512`, `DEPTH=16`\nas described in section Methods.\nTo stay under IMO time limits, 4 V100-GPUs and 250 CPU workers\nare needed as shown in Extended Data - Figure 1.\nNote that we also strip away other memory\u002Fspeed optimizations\ndue to internal dependencies and to promote code clarity.\n\nAssume the downloaded checkpoint and vocabulary is placed in `DATA`,\nand the installed `meliad` source code is at `MELIAD_PATH`.\nWe make use of the `gin` library to manage model configurations,\nfollowing `meliad` conventions. We now define the flags relevant to the\nlanguage model:\n\n```shell\nLM_ARGS=(\n  --ckpt_path=$DATA \\\n  --vocab_path=$DATA\u002Fgeometry.757.model\n  --gin_search_paths=$MELIAD_PATH\u002Ftransformer\u002Fconfigs,$(pwd) \\\n  --gin_file=base_htrans.gin \\\n  --gin_file=size\u002Fmedium_150M.gin \\\n  --gin_file=options\u002Fpositions_t5.gin \\\n  --gin_file=options\u002Flr_cosine_decay.gin \\\n  --gin_file=options\u002Fseq_1024_nocache.gin \\\n  --gin_file=geometry_150M_generate.gin \\\n  --gin_param=DecoderOnlyLanguageModelGenerate.output_token_losses=True \\\n  --gin_param=TransformerTaskConfig.batch_size=$BATCH_SIZE \\\n  --gin_param=TransformerTaskConfig.sequence_length=128 \\\n  --gin_param=Trainer.restore_state_variables=False\n);\n```\n\nTIP: Note that you can still run the DDAR solver\nwithout defining `SEARCH_ARGS` and `LM_ARGS`.\nIn such case, simply disable the import of the `lm_inference` module\ninside `alphageometry.py`.\n\n## Run DDAR\n\nThe script loads a problem by reading a list of problems\nfrom a text file and solves the specific problem in the list according\nto its name. We pass these two pieces of information through the flags\n`--problems_file` and `--problem_name`.\nWe use `--mode=ddar` to indicate that we want to use the DDAR solver.\n\nBelow we showed this solver solving IMO 2000 P1:\n\n```shell\npython -m alphageometry \\\n--alsologtostderr \\\n--problems_file=$(pwd)\u002Fimo_ag_30.txt \\\n--problem_name=translated_imo_2000_p1 \\\n--mode=ddar \\\n\"${DDAR_ARGS[@]}\"\n```\n\nExpect the following output\n\n```shell\ngraph.py:468] translated_imo_2000_p1\ngraph.py:469] a b = segment a b; g1 = on_tline g1 a a b; g2 = on_tline g2 b b a; m = on_circle m g1 a, on_circle m g2 b; n = on_circle n g1 a, on_circle n g2 b; c = on_pline c m a b, on_circle c g1 a; d = on_pline d m a b, on_circle d g2 b; e = on_line e a c, on_line e b d; p = on_line p a n, on_line p c d; q = on_line q b n, on_line q c d ? cong e p e q\nddar.py:41] Depth 1\u002F1000 time = 1.7772269248962402\nddar.py:41] Depth 2\u002F1000 time = 5.63526177406311\nddar.py:41] Depth 3\u002F1000 time = 6.883412837982178\nddar.py:41] Depth 4\u002F1000 time = 10.275688409805298\nddar.py:41] Depth 5\u002F1000 time = 12.048273086547852\nalphageometry.py:190]\n==========================\n * From theorem premises:\nA B G1 G2 M N C D E P Q : Points\nAG_1 ⟂ AB [00]\nBA ⟂ G_2B [01]\nG_2M = G_2B [02]\nG_1M = G_1A [03]\n\n...\n[log omitted]\n...\n\n036. ∠QEB = ∠(QP-EA) [46] & ∠(BE-QP) = ∠AEP [55] ⇒  ∠EQP = ∠QPE [56]\n037. ∠PQE = ∠EPQ [56] ⇒  EP = EQ\n\n==========================\n```\n\nThe output first includes a list of relevant premises that it uses,\nand then proof steps that gradually build up the proof.\nAll predicates are numbered to track how they are derived\nfrom the premises, and to show that the proof is fully justified.\n\nTIP: Additionally passing the flag `--out_file=path\u002Fto\u002Foutput\u002Ftext\u002Ffile.txt`\nwill write the proof to a text file.\n\nRunning on all problems in `imo_ag_30.txt` will yield solutions to\n14 of them, as reported in Table 1 in our paper.\n\n## Run AlphaGeometry:\n\nAs a simple example, we load `--problem_name=orthocenter`\nfrom `--problem_file=examples.txt`.\nThis time, we pass `--mode=alphageometry` to use the AlphaGeometry solver\nand pass the `SEARCH_ARGS` and `LM_ARGS` flags.\n\n```shell\npython -m alphageometry \\\n--alsologtostderr \\\n--problems_file=$(pwd)\u002Fexamples.txt \\\n--problem_name=orthocenter \\\n--mode=alphageometry \\\n\"${DDAR_ARGS[@]}\" \\\n\"${SEARCH_ARGS[@]}\" \\\n\"${LM_ARGS[@]}\"\n```\n\nExpect the following output:\n\n```shell\n...\n[log omitted]\n...\ntraining_loop.py:725] Total parameters: 152072288\ntraining_loop.py:739] Total state size: 0\ntraining_loop.py:492] Training loop: creating task for mode beam_search\n\ngraph.py:468] orthocenter\ngraph.py:469] a b c = triangle a b c; d = on_tline d b a c, on_tline d c a b ? perp a d b c\nddar.py:41] Depth 1\u002F1000 time = 0.009987592697143555 branch = 4\nddar.py:41] Depth 2\u002F1000 time = 0.00672602653503418 branch = 0\nalphageometry.py:221] DD+AR failed to solve the problem.\nalphageometry.py:457] Depth 0. There are 1 nodes to expand:\nalphageometry.py:460] {S} a : ; b : ; c : ; d : T a b c d 00 T a c b d 01 ? T a d b c {F1} x00\nalphageometry.py:465] Decoding from {S} a : ; b : ; c : ; d : T a b c d 00 T a c b d 01 ? T a d b c {F1} x00\n...\n[log omitted]\n...\nalphageometry.py:470] LM output (score=-1.102287): \"e : C a c e 02 C b d e 03 ;\"\nalphageometry.py:471] Translation: \"e = on_line e a c, on_line e b d\"\n\nalphageometry.py:480] Solving: \"a b c = triangle a b c; d = on_tline d b a c, on_tline d c a b; e = on_line e a c, on_line e b d ? perp a d b c\"\ngraph.py:468]\ngraph.py:469] a b c = triangle a b c; d = on_tline d b a c, on_tline d c a b; e = on_line e a c, on_line e b d ? perp a d b c\nddar.py:41] Depth 1\u002F1000 time = 0.021120786666870117\nddar.py:41] Depth 2\u002F1000 time = 0.033370018005371094\nddar.py:41] Depth 3\u002F1000 time = 0.04297471046447754\nalphageometry.py:140]\n==========================\n * From theorem premises:\nA B C D : Points\nBD ⟂ AC [00]\nCD ⟂ AB [01]\n\n * Auxiliary Constructions:\nE : Points\nE,B,D are collinear [02]\nE,C,A are collinear [03]\n\n * Proof steps:\n001. E,B,D are collinear [02] & E,C,A are collinear [03] & BD ⟂ AC [00] ⇒  ∠BEA = ∠CED [04]\n002. E,B,D are collinear [02] & E,C,A are collinear [03] & BD ⟂ AC [00] ⇒  ∠BEC = ∠AED [05]\n003. A,E,C are collinear [03] & E,B,D are collinear [02] & AC ⟂ BD [00] ⇒  EC ⟂ EB [06]\n004. EC ⟂ EB [06] & CD ⟂ AB [01] ⇒  ∠(EC-BA) = ∠(EB-CD) [07]\n005. E,C,A are collinear [03] & E,B,D are collinear [02] & ∠(EC-BA) = ∠(EB-CD) [07] ⇒  ∠BAE = ∠CDE [08]\n006. ∠BEA = ∠CED [04] & ∠BAE = ∠CDE [08] (Similar Triangles)⇒  EB:EC = EA:ED [09]\n007. EB:EC = EA:ED [09] & ∠BEC = ∠AED [05] (Similar Triangles)⇒  ∠BCE = ∠ADE [10]\n008. EB:EC = EA:ED [09] & ∠BEC = ∠AED [05] (Similar Triangles)⇒  ∠EBC = ∠EAD [11]\n009. ∠BCE = ∠ADE [10] & E,C,A are collinear [03] & E,B,D are collinear [02] & ∠EBC = ∠EAD [11] ⇒  AD ⟂ BC\n==========================\n\nalphageometry.py:505] Solved.\n```\n\nNOTE: Point `H` is automatically renamed to `D`,\nas the LM is trained on synthetic problems\nwhere the points are named alphabetically, and so it expects\nthe same during test time.\n\nNOTE: In this implementation of AlphaGeometry,\nwe removed all optimizations that are dependent on\ninternal infrastructure, e.g.,\nparallelized model inference on multi GPUs,\nparallelized DDAR on multiple CPUs,\nparallel execution of LM and DDAR,\nshared pool of CPU workers across different problems, etc.\nWe also removed some memory\u002Fspeed optimizations and code\nabstractions in favor of code clarity.\n\nAs can be seen in the output, initially DDAR failed to solve the problem.\nThe LM proposes two auxiliary constructions (because `BATCH_SIZE=2`):\n\n* `e = eqdistance e c a b, eqdistance e b a c`, i.e.,\nconstruct `E` as the intersection of circle (center=C, radius=AB) and\ncircle (center=B, radius=AC). This construction has a score of `-1.186`.\n* `e = on_line e a c, on_line e b d`, i.e.,\n`E` is the intersection of `AC` and `BD`.\nThis construction has a higher score (`-1.102287`) than the previous.\n\nSince the second construction has a higher score, DDAR attempted the second\nconstruction first and found the solution right away.\nThe proof search therefore terminates and there is no second iteration.\n\n## Results\n\nBefore attempting to reproduce the AlphaGeometry numbers in our paper,\nplease make sure to pass all tests in the prepared test suite:\n\n```\nbash run_tests.sh\n```\n\nNOTE: [Issues#14](https:\u002F\u002Fgithub.com\u002Fgoogle-deepmind\u002Falphageometry\u002Fissues\u002F14) reports that although the top beam decodes are still the same, the LM is not giving the same score for different users.\n\nThen, pass the corresponding values for `--problem_file` (column)\nand `--mode` (row), and\niterate on all problems to obtain the following results:\n\n\u003Ccenter>\n\n\u003Cb>Number of solved problems:\u003C\u002Fb>\n\n|          | `imo_ag_30.txt`  | `jgex_ag_231.txt` |\n|----------|------------------|-------------------|\n| `ddar`   | 14               | 198               |\n| `alphageometry`     | 25               | 228               |\n\n\u003C\u002Fcenter>\n\n## Source code description\n\nFiles in this repository include python modules\u002Fscripts to run the solvers and\nresource files necessary for the script to execute. We listed below\neach of them and their description.\n\n| File name              | Description                                                                        |\n|------------------------|------------------------------------------------------------------------------------|\n| `geometry.py`          | Implements nodes (Point, Line, Circle, etc) in the proof state graph.              |\n| `numericals.py`        | Implements the numerical engine in the dynamic geometry environment.               |\n| `graph_utils.py`       | Implements utilities for the proof state graph.                                    |\n| `graph.py`             | Implements the proof state graph.                                                  |\n| `problem.py`           | Implements the classes that represent the problem premises, conclusion, DAG nodes. |\n| `dd.py`                | Implements DD and its traceback.                                                   |\n| `ar.py`                | Implements AR and its traceback.                                                   |\n| `trace_back.py`        | Implements the recursive traceback and dependency difference algorithm.            |\n| `ddar.py`              | Implements the combination DD+AR.                                                  |\n| `beam_search.py`       | Implements beam decoding of a language model in JAX.                               |\n| `models.py`            | Implements the transformer model.                                                  |\n| `transformer_layer.py` | Implements the transformer layer.                                                  |\n| `decoder_stack.py`     | Implements the transformer decoder stack.                                          |\n| `lm_inference.py`      | Implements an interface to a trained LM to perform decoding.                       |\n| `alphageometry.py`                | Main script that loads problems, calls DD+AR or AlphaGeometry solver, and prints solutions.   |\n| `pretty.py`            | Pretty formating the solutions output by solvers.                                  |\n| `*_test.py`            | Tests for the corresponding module.                                                |\n| `download.sh`          | Script to download model checkpoints and LM                                        |\n| `run.sh`               | Script to execute instructions in README.                                          |\n| `run_tests.sh`         | Script to execute the test suite.                                                  |\n\n\nResource files:\n\n| Resource file name     | Description                                                                        |\n|------------------------|------------------------------------------------------------------------------------|\n| `defs.txt`             | Definitions of different geometric construction actions.                           |\n| `rules.txt`            | Deduction rules for DD.                                                            |\n| `geometry_150M_generate.gin`| Gin config of the LM implemented in meliad.                                   |\n| `imo_ag_30.txt`        | Problems in IMO-AG-30.                                                             |\n| `jgex_ag_231.txt`      | Problems in JGEX-AG-231.                                                           |\n\n\n\n## Citing this work\n\n```bibtex\n@Article{AlphaGeometryTrinh2024,\n  author  = {Trinh, Trieu and Wu, Yuhuai and Le, Quoc and He, He and Luong, Thang},\n  journal = {Nature},\n  title   = {Solving Olympiad Geometry without Human Demonstrations},\n  year    = {2024},\n  doi     = {10.1038\u002Fs41586-023-06747-5}\n}\n```\n\n## Acknowledgements\n\nThis research is a collaboration between the Google Brain team\n(now Google Deepmind) and\nthe Computer Science Department of New York University.\nWe thank Rif A. Saurous, Denny Zhou, Christian Szegedy, Delesley Hutchins,\nThomas Kipf, Hieu Pham, Petar Veličković, Debidatta Dwibedi,\nKyunghyun Cho, Lerrel Pinto, Alfredo Canziani,\nThomas Wies, He He’s research group,\nEvan Chen (the USA’s IMO team coach),\nMirek Olsak, Patrik Bak,\nand all three Nature's referees for their help and support.\n\nThe code of AlphaGeometry communicates with and\u002For references the following\nseparate libraries and packages:\n\n*   [Abseil](https:\u002F\u002Fgithub.com\u002Fabseil\u002Fabseil-py)\n*   [JAX](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fjax\u002F)\n*   [matplotlib](https:\u002F\u002Fmatplotlib.org\u002F)\n*   [NumPy](https:\u002F\u002Fnumpy.org)\n*   [SciPy](https:\u002F\u002Fscipy.org)\n*   [TensorFlow](https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Ftensorflow)\n*   [Meliad](https:\u002F\u002Fgithub.com\u002Fgoogle-research\u002Fmeliad)\n*   [Flax](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fflax)\n*   [Gin](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fgin-config)\n*   [T5](https:\u002F\u002Fgithub.com\u002Fgoogle-research\u002Ftext-to-text-transfer-transformer)\n*   [SentencePiece](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fsentencepiece)\n\n\n\nWe thank all their contributors and maintainers!\n\n\n## Disclaimer\n\nThis is not an officially supported Google product.\n\nThis research code is provided \"as-is\" to the broader research community.\nGoogle does not promise to maintain or otherwise support this code in any way.\n\n## Code License\n\nCopyright 2023 DeepMind Technologies Limited\n\nAll software is licensed under the Apache License, Version 2.0 (Apache 2.0);\nyou may not use this file except in compliance with the Apache 2.0 license.\nYou may obtain a copy of the Apache 2.0 license at:\nhttps:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0\n\nAll other materials are licensed under the Creative Commons Attribution 4.0\nInternational License (CC-BY). You may obtain a copy of the CC-BY license at:\nhttps:\u002F\u002Fcreativecommons.org\u002Flicenses\u002Fby\u002F4.0\u002Flegalcode\n\nUnless required by applicable law or agreed to in writing, all software and\nmaterials distributed here under the Apache 2.0 or CC-BY licenses are\ndistributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,\neither express or implied. See the licenses for the specific language governing\npermissions and limitations under those licenses.\n\n## Model Parameters License\n\nThe AlphaGeometry checkpoints and vocabulary are made available\nunder the terms of the Creative Commons Attribution 4.0\nInternational (CC BY 4.0) license.\nYou can find details at:\nhttps:\u002F\u002Fcreativecommons.org\u002Flicenses\u002Fby\u002F4.0\u002Flegalcode\n\n","# 无需人类示范即可解决奥数几何问题\n\n\n此仓库包含复现DDAR和AlphaGeometry所需的代码，\n这两款几何定理证明器在2024年《自然》杂志论文中被介绍：\n\n*\u003Ccenter>“无需人类示范即可解决奥数几何问题”。\u003C\u002Fcenter>*\n\n\n\u003C\u002Fbr>\n\n\n\u003Ccenter>\n\u003Cimg alt=\"fig1\" width=\"800px\" src=\"fig1.svg\">\n\u003C\u002Fcenter>\n\n**更新（2026年1月）：** AlphaGeometry2已[发表](https:\u002F\u002Fjmlr.org\u002Fpapers\u002Fv26\u002F25-1654.html)，其用于DDAR的代码已在[alphageometry2](https:\u002F\u002Fgithub.com\u002Fgoogle-deepmind\u002Falphageometry2)中发布。\n\n\n## 依赖项\n\n在以下说明中，我们使用Python 3.10.9，并且依赖项及其确切版本号列于`requirements.txt`文件中。\n\n我们的代码依赖于`meliad`，它并未注册到`pip`包管理器中。有关如何手动安装`meliad`的说明见下文。\n\n请注意，即使没有`meliad`和`sentencepiece`依赖项，仍然可以运行DDAR求解器。\n\n## 运行说明\n\n本`README.md`中的所有说明可以通过以下命令一次性执行：\n\n```\nbash run.sh\n```\n\n下面我们将逐步解释这些说明。\n\n## 安装依赖项、下载权重和词汇表\n\n安装过程在一个虚拟环境中进行：\n\n```\nvirtualenv -p python3 .\nsource .\u002Fbin\u002Factivate\npip install --require-hashes -r requirements.txt\n```\n\n下载权重和词汇表：\n\n```\nbash download.sh\nDATA=ag_ckpt_vocab\n```\n\n最后，由于`meliad`未注册到`pip`，需单独安装：\n\n```\nMELIAD_PATH=meliad_lib\u002Fmeliad\nmkdir -p $MELIAD_PATH\ngit clone https:\u002F\u002Fgithub.com\u002Fgoogle-research\u002Fmeliad $MELIAD_PATH\nexport PYTHONPATH=$PYTHONPATH:$MELIAD_PATH\n```\n\n## 设置常用参数\n\n在运行Python脚本之前，我们先准备一些常用的参数。符号引擎需要定义和推理规则才能运行。这些定义和规则分别提供在`defs.txt`和`rules.txt`两个文本文件中。\n\n```shell\nDDAR_ARGS=(\n  --defs_file=$(pwd)\u002Fdefs.txt \\\n  --rules_file=$(pwd)\u002Frules.txt \\\n);\n```\n\n接下来，我们定义与证明搜索相关的参数。为了复现下面的简单示例，我们使用较轻量级的搜索参数值：\n\n```shell\nBATCH_SIZE=2\nBEAM_SIZE=2\nDEPTH=2\n\nSEARCH_ARGS=(\n  --beam_size=$BEAM_SIZE\n  --search_depth=$DEPTH\n)\n```\n\n注意：我们论文中的结果可以通过设置`BATCH_SIZE=32`、`BEAM_SIZE=512`、`DEPTH=16`来获得，具体如方法部分所述。为满足IMO竞赛的时间限制，需要4张V100显卡和250个CPU工作进程，详见扩展数据图1。此外，我们还去除了其他内存和速度优化措施，以减少内部依赖并提高代码可读性。\n\n假设下载的检查点和词汇表位于`DATA`目录下，而安装的`meliad`源代码位于`MELIAD_PATH`目录。我们使用`gin`库来管理模型配置，遵循`meliad`的惯例。现在我们定义与语言模型相关的参数：\n\n```shell\nLM_ARGS=(\n  --ckpt_path=$DATA \\\n  --vocab_path=$DATA\u002Fgeometry.757.model\n  --gin_search_paths=$MELIAD_PATH\u002Ftransformer\u002Fconfigs,$(pwd) \\\n  --gin_file=base_htrans.gin \\\n  --gin_file=size\u002Fmedium_150M.gin \\\n  --gin_file=options\u002Fpositions_t5.gin \\\n  --gin_file=options\u002Flr_cosine_decay.gin \\\n  --gin_file=options\u002Fseq_1024_nocache.gin \\\n  --gin_file=geometry_150M_generate.gin \\\n  --gin_param=DecoderOnlyLanguageModelGenerate.output_token_losses=True \\\n  --gin_param=TransformerTaskConfig.batch_size=$BATCH_SIZE \\\n  --gin_param=TransformerTaskConfig.sequence_length=128 \\\n  --gin_param=Trainer.restore_state_variables=False\n);\n```\n\n提示：即使不定义`SEARCH_ARGS`和`LM_ARGS`，仍然可以运行DDAR求解器。在这种情况下，只需在`alphageometry.py`中禁用`lm_inference`模块的导入即可。\n\n## 运行DDAR\n\n该脚本通过读取文本文件中的问题列表来加载一个问题，并根据其名称解决列表中的特定问题。我们通过`--problems_file`和`--problem_name`这两个参数传递这两条信息。我们使用`--mode=ddar`来指示要使用DDAR求解器。\n\n下面我们展示了该求解器如何解决2000年IMO第1题：\n\n```shell\npython -m alphageometry \\\n--alsologtostderr \\\n--problems_file=$(pwd)\u002Fimo_ag_30.txt \\\n--problem_name=translated_imo_2000_p1 \\\n--mode=ddar \\\n\"${DDAR_ARGS[@]}\"\n```\n\n预期输出如下：\n\n```shell\ngraph.py:468] translated_imo_2000_p1\ngraph.py:469] a b = segment a b; g1 = on_tline g1 a a b; g2 = on_tline g2 b b a; m = on_circle m g1 a, on_circle m g2 b; n = on_circle n g1 a, on_circle n g2 b; c = on_pline c m a b, on_circle c g1 a; d = on_pline d m a b, on_circle d g2 b; e = on_line e a c, on_line e b d; p = on_line p a n, on_line p c d; q = on_line q b n, on_line q c d ? cong e p e q\nddar.py:41] Depth 1\u002F1000 time = 1.7772269248962402\nddar.py:41] Depth 2\u002F1000 time = 5.63526177406311\nddar.py:41] Depth 3\u002F1000 time = 6.883412837982178\nddar.py:41] Depth 4\u002F1000 time = 10.275688409805298\nddar.py:41] Depth 5\u002F1000 time = 12.048273086547852\nalphageometry.py:190]\n==========================\n * From theorem premises:\nA B G1 G2 M N C D E P Q : Points\nAG_1 ⟂ AB [00]\nBA ⟂ G_2B [01]\nG_2M = G_2B [02]\nG_1M = G_1A [03]\n\n...\n[log omitted]\n...\n\n036. ∠QEB = ∠(QP-EA) [46] & ∠(BE-QP) = ∠AEP [55] ⇒  ∠EQP = ∠QPE [56]\n037. ∠PQE = ∠EPQ [56] ⇒  EP = EQ\n\n==========================\n```\n\n输出首先列出所使用的相关前提条件，然后逐步展示证明步骤。所有谓词都进行了编号，以便追踪它们是如何从前提条件推导出来的，并证明整个证明是完全合理的。\n\n提示：此外，如果添加`--out_file=path\u002Fto\u002Foutput\u002Ftext\u002Ffile.txt`参数，证明内容将被写入指定的文本文件中。\n\n在`imo_ag_30.txt`中的所有问题上运行后，将得到其中14个问题的解答，正如我们论文中的表1所示。\n\n## 运行 AlphaGeometry：\n\n作为一个简单的示例，我们从 `--problem_file=examples.txt` 中加载 `--problem_name=orthocenter`。\n这一次，我们传递 `--mode=alphageometry` 来使用 AlphaGeometry 求解器，并传递 `SEARCH_ARGS` 和 `LM_ARGS` 标志。\n\n```shell\npython -m alphageometry \\\n--alsologtostderr \\\n--problems_file=$(pwd)\u002Fexamples.txt \\\n--problem_name=orthocenter \\\n--mode=alphageometry \\\n\"${DDAR_ARGS[@]}\" \\\n\"${SEARCH_ARGS[@]}\" \\\n\"${LM_ARGS[@]}\"\n```\n\n预期输出如下：\n\n```shell\n...\n[日志省略]\n...\ntraining_loop.py:725] 总参数量：152072288\ntraining_loop.py:739] 总状态大小：0\ntraining_loop.py:492] 训练循环：为模式 beam_search 创建任务\n\ngraph.py:468] 垂心\ngraph.py:469] a b c = 三角形 a b c；d = 在 tline d b a c 上，也在 tline d c a b 上？垂线 a d b c\nddar.py:41] 深度 1\u002F1000 时间 = 0.009987592697143555 分支 = 4\nddar.py:41] 深度 2\u002F1000 时间 = 0.00672602653503418 分支 = 0\nalphageometry.py:221] DD+AR 未能解决该问题。\nalphageometry.py:457] 深度 0。有 1 个节点待扩展：\nalphageometry.py:460] {S} a : ; b : ; c : ; d : T a b c d 00 T a c b d 01 ? T a d b c {F1} x00\nalphageometry.py:465] 从 {S} a : ; b : ; c : ; d : T a b c d 00 T a c b d 01 ? T a d b c {F1} x00 解码\n...\n[日志省略]\n...\nalphageometry.py:470] LM 输出（分数=-1.102287）：“e : C a c e 02 C b d e 03；”\nalphageometry.py:471] 翻译：“e = 在线 e a c 上，也在线 e b d 上”\n\nalphageometry.py:480] 求解：“a b c = 三角形 a b c；d = 在 tline d b a c 上，也在 tline d c a b 上；e = 在线 e a c 上，也在线 e b d 上？垂线 a d b c”\ngraph.py:468]\ngraph.py:469] a b c = 三角形 a b c；d = 在 tline d b a c 上，也在 tline d c a b 上；e = 在线 e a c 上，也在线 e b d 上？垂线 a d b c\nddar.py:41] 深度 1\u002F1000 时间 = 0.021120786666870117\nddar.py:41] 深度 2\u002F1000 时间 = 0.033370018005371094\nddar.py:41] 深度 3\u002F1000 时间 = 0.04297471046447754\nalphageometry.py:140]\n==========================\n * 由定理前提：\nA B C D：点\nBD ⟂ AC [00]\nCD ⟂ AB [01]\n\n * 辅助构造：\nE：点\nE,B,D 共线 [02]\nE,C,A 共线 [03]\n\n * 证明步骤：\n001. E,B,D 共线 [02] & E,C,A 共线 [03] & BD ⟂ AC [00] ⇒ ∠BEA = ∠CED [04]\n002. E,B,D 共线 [02] & E,C,A 共线 [03] & BD ⟂ AC [00] ⇒ ∠BEC = ∠AED [05]\n003. A,E,C 共线 [03] & E,B,D 共线 [02] & AC ⟂ BD [00] ⇒ EC ⟂ EB [06]\n004. EC ⟂ EB [06] & CD ⟂ AB [01] ⇒ ∠(EC-BA) = ∠(EB-CD) [07]\n005. E,C,A 共线 [03] & E,B,D 共线 [02] & ∠(EC-BA) = ∠(EB-CD) [07] ⇒ ∠BAE = ∠CDE [08]\n006. ∠BEA = ∠CED [04] & ∠BAE = ∠CDE [08]（相似三角形）⇒ EB:EC = EA:ED [09]\n007. EB:EC = EA:ED [09] & ∠BEC = ∠AED [05]（相似三角形）⇒ ∠BCE = ∠ADE [10]\n008. EB:EC = EA:ED [09] & ∠BEC = ∠AED [05]（相似三角形）⇒ ∠EBC = ∠EAD [11]\n009. ∠BCE = ∠ADE [10] & E,C,A 共线 [03] & E,B,D 共线 [02] & ∠EBC = ∠EAD [11] ⇒ AD ⟂ BC\n==========================\n\nalphageometry.py:505] 已解决。\n```\n\n注意：点 `H` 会被自动重命名为 `D`，\n因为语言模型是在合成问题上训练的，\n这些问题中的点都按字母顺序命名，因此在测试时它也期望相同的命名方式。\n\n注意：在本实现的 AlphaGeometry 中，\n我们移除了所有依赖于内部基础设施的优化措施，例如：\n多 GPU 上的并行模型推理、多 CPU 上的并行 DDAR、LM 和 DDAR 的并行执行、\n不同问题之间共享的 CPU 工作池等。\n我们还移除了部分内存\u002F速度优化和代码抽象，以提高代码的可读性。\n\n从输出中可以看出，最初 DDAR 未能解决该问题。\n语言模型提出了两个辅助构造（因为 `BATCH_SIZE=2`）：\n\n* `e = eqdistance e c a b, eqdistance e b a c`，即\n将 `E` 构造为以 C 为圆心、半径为 AB 的圆与以 B 为圆心、半径为 AC 的圆的交点。该构造的得分为 `-1.186`。\n* `e = on_line e a c, on_line e b d`，即\n`E` 是 `AC` 和 `BD` 的交点。该构造的得分更高（`-1.102287`）比前一个。\n\n由于第二个构造的得分更高，DDAR 首先尝试了第二个构造，并立即找到了解决方案。\n因此，证明搜索终止，没有进行第二次迭代。\n\n## 结果\n\n在尝试复现我们论文中的 AlphaGeometry 数据之前，\n请确保通过准备好的测试套件中的所有测试：\n\n```\nbash run_tests.sh\n```\n\n注意：[Issues#14](https:\u002F\u002Fgithub.com\u002Fgoogle-deepmind\u002Falphageometry\u002Fissues\u002F14) 报告称，尽管顶级波束解码仍然相同，但语言模型对不同用户给出的分数并不一致。\n\n然后，传递 `--problem_file`（列）和 `--mode`（行）的相应值，\n并对所有问题进行迭代，以获得以下结果：\n\n\u003Ccenter>\n\n\u003Cb>已解决问题的数量：\u003C\u002Fb>\n\n|          | `imo_ag_30.txt`  | `jgex_ag_231.txt` |\n|----------|------------------|-------------------|\n| `ddar`   | 14               | 198               |\n| `alphageometry`     | 25               | 228               |\n\n\u003C\u002Fcenter>\n\n## 源代码说明\n\n本仓库中的文件包括用于运行求解器的 Python 模块\u002F脚本，以及脚本执行所需的资源文件。我们将在下面列出每个文件及其描述。\n\n| 文件名              | 描述                                                                        |\n|------------------------|------------------------------------------------------------------------------|\n| `geometry.py`          | 实现证明状态图中的节点（点、线、圆等）。                                    |\n| `numericals.py`        | 实现动态几何环境中的数值引擎。                                              |\n| `graph_utils.py`       | 实现证明状态图的工具函数。                                                  |\n| `graph.py`             | 实现证明状态图。                                                            |\n| `problem.py`           | 实现表示问题前提、结论及 DAG 节点的类。                                     |\n| `dd.py`                | 实现 DD 及其回溯机制。                                                      |\n| `ar.py`                | 实现 AR 及其回溯机制。                                                      |\n| `trace_back.py`        | 实现递归回溯和依赖差异算法。                                                |\n| `ddar.py`              | 实现 DD+AR 的组合方法。                                                     |\n| `beam_search.py`       | 在 JAX 中实现语言模型的束搜索解码。                                         |\n| `models.py`            | 实现 Transformer 模型。                                                     |\n| `transformer_layer.py` | 实现 Transformer 层。                                                       |\n| `decoder_stack.py`     | 实现 Transformer 解码器堆栈。                                               |\n| `lm_inference.py`      | 实现与训练好的语言模型交互以进行解码的接口。                              |\n| `alphageometry.py`                | 主脚本，用于加载问题、调用 DD+AR 或 AlphaGeometry 求解器，并输出解。   |\n| `pretty.py`            | 对求解器输出的解进行美化格式化。                                           |\n| `*_test.py`            | 对应模块的测试文件。                                                        |\n| `download.sh`          | 用于下载模型检查点和语言模型的脚本。                                      |\n| `run.sh`               | 执行 README 中指令的脚本。                                                  |\n| `run_tests.sh`         | 执行测试套件的脚本。                                                      |\n\n\n资源文件：\n\n| 资源文件名     | 描述                                                                        |\n|------------------------|------------------------------------------------------------------------------|\n| `defs.txt`             | 不同几何作图操作的定义。                                                    |\n| `rules.txt`            | DD 的推理规则。                                                             |\n| `geometry_150M_generate.gin`| meliad 中实现的语言模型的 Gin 配置。                                   |\n| `imo_ag_30.txt`        | IMO-AG-30 中的问题。                                                        |\n| `jgex_ag_231.txt`      | JGEX-AG-231 中的问题。                                                      |\n\n\n\n## 引用本工作\n\n```bibtex\n@Article{AlphaGeometryTrinh2024,\n  author  = {Trinh, Trieu and Wu, Yuhuai and Le, Quoc and He, He and Luong, Thang},\n  journal = {Nature},\n  title   = {Solving Olympiad Geometry without Human Demonstrations},\n  year    = {2024},\n  doi     = {10.1038\u002Fs41586-023-06747-5}\n}\n```\n\n## 致谢\n\n本研究是 Google Brain 团队（现为 Google DeepMind）与纽约大学计算机科学系的合作成果。我们感谢 Rif A. Saurous、Denny Zhou、Christian Szegedy、Delesley Hutchins、Thomas Kipf、Hieu Pham、Petar Veličković、Debidatta Dwibedi、Kyunghyun Cho、Lerrel Pinto、Alfredo Canziani、Thomas Wies、He He 的研究团队、Evan Chen（美国 IMO 团队教练）、Mirek Olsak、Patrik Bak，以及 Nature 杂志的三位审稿人，感谢他们提供的帮助和支持。\n\nAlphaGeometry 的代码与以下独立库和软件包进行通信或引用：\n\n*   [Abseil](https:\u002F\u002Fgithub.com\u002Fabseil\u002Fabseil-py)\n*   [JAX](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fjax\u002F)\n*   [matplotlib](https:\u002F\u002Fmatplotlib.org\u002F)\n*   [NumPy](https:\u002F\u002Fnumpy.org)\n*   [SciPy](https:\u002F\u002Fscipy.org)\n*   [TensorFlow](https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Ftensorflow)\n*   [Meliad](https:\u002F\u002Fgithub.com\u002Fgoogle-research\u002Fmeliad)\n*   [Flax](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fflax)\n*   [Gin](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fgin-config)\n*   [T5](https:\u002F\u002Fgithub.com\u002Fgoogle-research\u002Ftext-to-text-transfer-transformer)\n*   [SentencePiece](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fsentencepiece)\n\n\n\n我们感谢所有这些项目的贡献者和维护者！\n\n\n## 免责声明\n\n本项目并非 Google 官方支持的产品。\n\n本研究代码以“现状”形式提供给更广泛的研究社区。Google 不承诺以任何方式维护或支持此代码。\n\n## 代码许可\n\n版权所有 © 2023 DeepMind Technologies Limited\n\n所有软件均采用 Apache License, Version 2.0（Apache 2.0）许可；除非符合 Apache 2.0 许可条款，否则不得使用本文件。您可以在以下网址获取 Apache 2.0 许可协议：  \nhttps:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0\n\n所有其他材料均采用 Creative Commons Attribution 4.0 国际许可（CC-BY）。您可以在以下网址获取 CC-BY 许可协议：  \nhttps:\u002F\u002Fcreativecommons.org\u002Flicenses\u002Fby\u002F4.0\u002Flegalcode\n\n除非适用法律要求或另有书面约定，否则在此处根据 Apache 2.0 或 CC-BY 许可分发的所有软件和材料均按“现状”提供，不附带任何形式的明示或默示担保或条件。具体的权利和限制请参阅相关许可协议。\n\n## 模型参数许可\n\nAlphaGeometry 的检查点和词汇表依据 Creative Commons Attribution 4.0 国际许可（CC BY 4.0）条款提供。详细信息请参见：  \nhttps:\u002F\u002Fcreativecommons.org\u002Flicenses\u002Fby\u002F4.0\u002Flegalcode","# AlphaGeometry 快速上手指南\n\nAlphaGeometry 是 Google DeepMind 开发的几何定理证明系统，结合了符号推理引擎（DDAR）和语言模型（LM），能够解决奥林匹克级别的几何问题而无需人类演示数据。\n\n## 环境准备\n\n*   **操作系统**: Linux 或 macOS (Windows 用户建议使用 WSL2)\n*   **Python 版本**: 推荐 Python 3.10.9\n*   **硬件要求**:\n    *   **仅运行 DDAR**: 普通 CPU 即可。\n    *   **运行完整 AlphaGeometry (含 LM)**: 需要 GPU 支持（论文实验使用 4x V100），若仅测试简单示例，单张消费级显卡或纯 CPU（速度较慢）也可尝试。\n*   **前置依赖**: `git`, `virtualenv`\n\n## 安装步骤\n\n### 1. 创建虚拟环境并安装基础依赖\n\n```bash\n# 创建虚拟环境\nvirtualenv -p python3 .\nsource .\u002Fbin\u002Factivate\n\n# 安装 requirements.txt 中列出的依赖包\npip install --require-hashes -r requirements.txt\n```\n\n### 2. 下载模型权重和词汇表\n\n执行官方提供的下载脚本，并将数据路径设置为环境变量：\n\n```bash\nbash download.sh\nexport DATA=ag_ckpt_vocab\n```\n\n### 3. 手动安装 `meliad` 库\n\n由于 `meliad` 未发布在 PyPI 上，需从源码安装：\n\n```bash\nexport MELIAD_PATH=meliad_lib\u002Fmeliad\nmkdir -p $MELIAD_PATH\n\n# 克隆仓库\ngit clone https:\u002F\u002Fgithub.com\u002Fgoogle-research\u002Fmeliad $MELIAD_PATH\n\n# 添加至 PYTHONPATH\nexport PYTHONPATH=$PYTHONPATH:$MELIAD_PATH\n```\n\n> **提示**: 国内用户若克隆 GitHub 速度慢，可尝试使用镜像源或代理加速 `git clone` 过程。\n\n## 基本使用\n\n在使用前，需先定义通用的配置参数（符号引擎规则、搜索参数及模型配置）。请在终端中依次执行以下命令设置环境变量：\n\n```bash\n# 1. 设置符号引擎规则文件路径\nDDAR_ARGS=(\n  --defs_file=$(pwd)\u002Fdefs.txt \\\n  --rules_file=$(pwd)\u002Frules.txt \\\n);\n\n# 2. 设置搜索参数 (示例使用轻量级参数，复现论文结果需调大数值)\nBATCH_SIZE=2\nBEAM_SIZE=2\nDEPTH=2\n\nSEARCH_ARGS=(\n  --beam_size=$BEAM_SIZE \\\n  --search_depth=$DEPTH \\\n);\n\n# 3. 设置语言模型配置\nLM_ARGS=(\n  --ckpt_path=$DATA \\\n  --vocab_path=$DATA\u002Fgeometry.757.model \\\n  --gin_search_paths=$MELIAD_PATH\u002Ftransformer\u002Fconfigs,$(pwd) \\\n  --gin_file=base_htrans.gin \\\n  --gin_file=size\u002Fmedium_150M.gin \\\n  --gin_file=options\u002Fpositions_t5.gin \\\n  --gin_file=options\u002Flr_cosine_decay.gin \\\n  --gin_file=options\u002Fseq_1024_nocache.gin \\\n  --gin_file=geometry_150M_generate.gin \\\n  --gin_param=DecoderOnlyLanguageModelGenerate.output_token_losses=True \\\n  --gin_param=TransformerTaskConfig.batch_size=$BATCH_SIZE \\\n  --gin_param=TransformerTaskConfig.sequence_length=128 \\\n  --gin_param=Trainer.restore_state_variables=False\n);\n```\n\n### 模式一：运行 DDAR (纯符号推理)\n\n适用于不需要神经网络辅助的几何问题，速度快，无需 GPU。\n\n```bash\npython -m alphageometry \\\n--alsologtostderr \\\n--problems_file=$(pwd)\u002Fimo_ag_30.txt \\\n--problem_name=translated_imo_2000_p1 \\\n--mode=ddar \\\n\"${DDAR_ARGS[@]}\"\n```\n\n**预期输出**: 终端将打印出推导步骤，包括前提条件、辅助构造点及最终的证明逻辑链。\n\n### 模式二：运行完整 AlphaGeometry (DDAR + 语言模型)\n\n适用于复杂问题，当纯符号推理失败时，语言模型会提议辅助构造线。\n\n```bash\npython -m alphageometry \\\n--alsologtostderr \\\n--problems_file=$(pwd)\u002Fexamples.txt \\\n--problem_name=orthocenter \\\n--mode=alphageometry \\\n\"${DDAR_ARGS[@]}\" \\\n\"${SEARCH_ARGS[@]}\" \\\n\"${LM_ARGS[@]}\"\n```\n\n**预期输出**:\n1. 系统首先尝试 DDAR，若失败则启动语言模型。\n2. 语言模型生成辅助构造建议（如添加新的点或线）。\n3. 系统基于新构造再次尝试证明，直至成功或耗尽搜索深度。\n4. 最终输出完整的证明过程，标记为 `Solved`。\n\n> **注意**: 若只需运行 DDAR 而不使用语言模型，可省略 `SEARCH_ARGS` 和 `LM_ARGS`，并在代码中禁用 `lm_inference` 模块导入以简化依赖。","某数学奥林匹克竞赛教练团队正致力于为选手生成高难度的几何证明题解，以辅助备训。\n\n### 没有 alphageometry 时\n- **依赖人工示范数据**：传统求解器需要大量人类标注的解题步骤作为训练数据，收集奥运级几何题的详细证明过程极其耗时且稀缺。\n- **复杂题目束手无策**：面对需要添加多条辅助线才能破解的 IMO（国际数学奥林匹克）级别难题，现有工具往往因搜索空间过大而直接失败。\n- **解题思路单一**：人工编写的题解通常只提供一种固定解法，难以展示同一道题目的多种创新证明路径，限制了学生的思维拓展。\n- **验证效率低下**：教练手动验证新编题目的可解性及正确性需要数小时甚至数天，严重拖累了题库的更新速度。\n\n### 使用 alphageometry 后\n- **零样本自主学习**：alphageometry 无需任何人类解题示范，仅凭符号引擎与语言模型的结合，即可从零开始推导并解决高难度几何定理。\n- **突破奥数难度上限**：借助强大的神经引导搜索策略，alphageometry 能成功构造出复杂的辅助线，解决了以往算法无法触及的奥运金牌级几何题。\n- **生成多样化证明**：该工具能自动探索并输出同一问题的多种不同证明方案，为教练提供了丰富的教学素材，帮助学生发散思维。\n- **秒级自动化验证**：输入题目描述后，alphageometry 可在极短时间内完成求解与验证，将新题入库的周期从“天”级缩短至“分钟”级。\n\nalphageometry 通过消除对人类经验的依赖，实现了从普通几何题到奥运压轴题的全自动、多路径智能证明，彻底重塑了高阶数学题目的生成与验证流程。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgoogle-deepmind_alphageometry_948a7011.png","google-deepmind","Google DeepMind","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fgoogle-deepmind_06b1dd17.png","","https:\u002F\u002Fwww.deepmind.com\u002F","https:\u002F\u002Fgithub.com\u002Fgoogle-deepmind",[83,87],{"name":84,"color":85,"percentage":86},"Python","#3572A5",99,{"name":88,"color":89,"percentage":54},"Shell","#89e051",4819,569,"2026-04-07T18:18:18","Apache-2.0",4,"未说明","运行完整 AlphaGeometry 复现论文结果需要 4 张 V100 GPU；仅运行 DDAR 求解器可不依赖 GPU","未说明（复现论文结果需配合 250 个 CPU 工作进程）",{"notes":99,"python":100,"dependencies":101},"1. 核心依赖 'meliad' 未注册在 pip 上，需手动克隆谷歌研究仓库并配置 PYTHONPATH。2. 可单独运行 DDAR 求解器而无需安装 meliad 和 sentencepiece。3. 为复现论文中的 IMO 解题效果，需设置特定参数（Batch Size 32, Beam Size 512, Depth 16）并拥有 4 张 V100 GPU 及大量 CPU 资源。4. 当前开源版本移除了部分内部基础设施相关的速度和内存优化代码，以确保证代码清晰。5. 需运行 download.sh 脚本下载模型权重和词汇表文件。","3.10.9",[102,103,104,105],"meliad (需手动从 GitHub 安装)","sentencepiece","gin","requirements.txt 中列出的其他依赖",[15,46],"2026-03-27T02:49:30.150509","2026-04-12T07:50:42.911388",[110,115,120,125,130,135],{"id":111,"question_zh":112,"answer_zh":113,"source_url":114},30465,"为什么证明步骤中会出现看似错误的角度等式（例如 ∠AHE = ∠AFE，而实际上它们互补）？","这是正确的。AlphaGeometry 使用的是“有向角”（directed angle）或“全角”（full angle）的定义，而非传统的几何角度定义。在有向角体系中，两个角相等当且仅当它们的正弦值相等（sin(α)=sin(β)），或者可以通过旋转形成平行线。这意味着一个角和它的补角在该定义下被视为相等。因此，即使传统几何中两角之和为 180°，在系统中显示为相等也是符合其逻辑规则的。","https:\u002F\u002Fgithub.com\u002Fgoogle-deepmind\u002Falphageometry\u002Fissues\u002F97",{"id":116,"question_zh":117,"answer_zh":118,"source_url":119},30466,"安装时遇到 'ERROR: No matching distribution found for jaxlib==0.4.6' 错误怎么办？","该错误通常是因为特定版本的 jaxlib  wheel 文件不支持当前操作系统。已知 jaxlib v0.4.6 的预编译包仅支持 Linux 和 macOS，不支持 Windows（Windows 最早支持版本为 0.4.13）。解决方案：1. Windows 用户建议使用 WSL (Windows Subsystem for Linux) 运行；2. 或者修改 requirements.txt，移除所有包的版本号锁定和哈希值（hashes），让 pip 自动安装兼容的最新版本。","https:\u002F\u002Fgithub.com\u002Fgoogle-deepmind\u002Falphageometry\u002Fissues\u002F51",{"id":121,"question_zh":122,"answer_zh":123,"source_url":124},30467,"输出中的符号 ∠(IA-EF) 是什么意思？","该符号表示由直线 IA 和直线 EF 形成的有向角。如果这两条直线相交于点 P，则 ∠(IA-EF) 等价于 ∠APF（或其对顶角）。这种表示法用于处理两条线段不直接共用顶点的情况，系统将其视为两条无限延伸直线的夹角。","https:\u002F\u002Fgithub.com\u002Fgoogle-deepmind\u002Falphageometry\u002Fissues\u002F156",{"id":126,"question_zh":127,"answer_zh":128,"source_url":129},30468,"如何在 AlphaGeometry 中添加新的几何推理规则？","不能仅通过修改配置文件（如 rules.txt）来添加新规则。代码库中每个规则都对应特定的 Python 函数实现。若要添加新规则，需要直接修改源代码，编写相应的逻辑函数并将其集成到推理引擎中。","https:\u002F\u002Fgithub.com\u002Fgoogle-deepmind\u002Falphageometry\u002Fissues\u002F87",{"id":131,"question_zh":132,"answer_zh":133,"source_url":134},30469,"运行 run.sh 时出现 'Translation: ERROR: must end with ;' 错误是什么原因？","这通常意味着语言模型（LM）生成的输出格式不正确，未能以分号 ';' 结尾，导致解析器无法识别完整的语句。这可能是由于模型输出了乱码（如日志中显示的 '?' 字符）或不完整的证明步骤。建议检查输入问题的格式是否符合规范，或尝试调整温度参数以减少模型生成无效内容的概率。","https:\u002F\u002Fgithub.com\u002Fgoogle-deepmind\u002Falphageometry\u002Fissues\u002F88",{"id":136,"question_zh":137,"answer_zh":138,"source_url":139},30470,"IMO 2015 P3 等官方发布的证明中，某些角度等式（如 ∠GMD = ∠GO2D）看起来在欧几里得几何中不成立，是错误吗？","这不是错误。与常见问题一样，这是因为论文和系统使用了“有向角”（directed angle）的定义。在这种定义下，角度具有方向性，且相差 180 度的角被视为相等。这使得几何定理的证明更加通用，无需区分点的相对位置顺序。","https:\u002F\u002Fgithub.com\u002Fgoogle-deepmind\u002Falphageometry\u002Fissues\u002F7",[]]