[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-hkust-nlp--CodeIO":3,"tool-hkust-nlp--CodeIO":64},[4,17,27,35,43,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,3,"2026-04-05T11:01:52",[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},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 真正成长为懂上",138956,2,"2026-04-05T11:33:21",[13,15,26],"语言模型",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":23,"last_commit_at":33,"category_tags":34,"status":16},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[13,14,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":23,"last_commit_at":41,"category_tags":42,"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,26],{"id":44,"name":45,"github_repo":46,"description_zh":47,"stars":48,"difficulty_score":23,"last_commit_at":49,"category_tags":50,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[14,51,52,53,15,54,26,13,55],"数据工具","视频","插件","其他","音频",{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[15,14,13,26,54],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":79,"owner_location":79,"owner_email":79,"owner_twitter":79,"owner_website":80,"owner_url":81,"languages":82,"stars":91,"forks":92,"last_commit_at":93,"license":79,"difficulty_score":10,"env_os":94,"env_gpu":95,"env_ram":96,"env_deps":97,"category_tags":103,"github_topics":79,"view_count":23,"oss_zip_url":79,"oss_zip_packed_at":79,"status":16,"created_at":104,"updated_at":105,"faqs":106,"releases":147},2603,"hkust-nlp\u002FCodeIO","CodeIO","[ICML 2025 Oral] CodeI\u002FO: Condensing Reasoning Patterns via Code Input-Output Prediction","CodeIO 是一项荣获 ICML 2025 口头报告殊荣的创新技术，旨在通过“代码输入 - 输出预测”来提炼通用的推理模式，从而显著提升大语言模型的逻辑推理能力。传统方法往往局限于特定技能训练，而 CodeIO 创造性地将多样化的代码执行逻辑转化为自然语言的思维链（Chain-of-Thought），让模型在脱离具体编程语法束缚的同时，保留严密的逻辑结构。\n\n这项技术有效解决了大模型在处理复杂符号运算、科学推导、数学问题及常识推理时逻辑不够严谨的痛点。其独特亮点在于“语法解耦”设计，既提取了普适的推理原语，又支持通过代码重执行或真值匹配进行精确的结果验证。此外，进阶版本 CodeIO++ 还引入了多轮修订机制，进一步提高了推理准确率。\n\nCodeIO 非常适合 AI 研究人员、大模型开发者以及需要增强模型逻辑能力的工程团队使用。项目已开源基于 Qwen 和 LLaMA 架构的多阶段训练模型及配套数据集（如 PythonEdu-Reasoning），用户可直接复用这些资源进行微调或基准测试，轻松为模型注入更强的逻辑推理基因。","\n\n# CodeI\u002FO: Condensing Reasoning Patterns via Code Input-Output Prediction\n\n\u003Cp align=\"center\">\n    📑 \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fpapers\u002F2502.07316\" target=\"_blank\">Paper\u003C\u002Fa> &nbsp&nbsp | &nbsp&nbsp 🌐 \u003Ca href=\"https:\u002F\u002Fcodei-o.github.io\u002F\" target=\"_blank\">Project Page\u003C\u002Fa> &nbsp&nbsp | &nbsp&nbsp 🤗 \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fcollections\u002Fhkust-nlp\u002Fcodei-o-67a978e28fd926b56a4f55a2\" target=\"_blank\">Released Resources\u003C\u002Fa> &nbsp&nbsp | &nbsp&nbsp 💾 \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fhkust-nlp\u002FCodeIO-PyEdu-Reasoning\" target=\"_blank\">Dataset\u003C\u002Fa> &nbsp&nbsp | &nbsp&nbsp 📦 \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fhkust-nlp\u002FCodeIO\" target=\"_blank\">Repo\u003C\u002Fa>  \n\u003Cbr>\n\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fhkust-nlp_CodeIO_readme_fc8b065a237d.png\" type=\"image\u002Fjpg\"\u002F>\n\u003Cp>\n\n## Table of contents\n\n- [Introduction](#Introduction)\n- [Released Resources](#Released-Resources)\n  - [Dataset](#Dataset)\n  - [Models](#Models)\n- [Get Started](#Get-Started)\n  - [Setup](#Setup)\n  - [Data Processing](#Data-Processing)\n  - [Training](#Training)\n- [Citation](#Citation)\n- [Acknowledgement](#Acknowledgement)\n\n## Introduction\nCodeI\u002FO is a novel approach that transforms code-based reasoning patterns into natural language formats to enhance Large Language Models' reasoning capabilities. Unlike traditional methods focusing on specific skills, our approach systematically extracts universal reasoning primitives while maintaining procedural rigor, enabling better performance across various reasoning tasks.\n\n**Key Features & Contributions**\n- 🔄 Universal Transformation: Converts diverse code patterns into natural language Chain-of-Thought rationales\n- 🧠 Syntax-Decoupled: Decouples reasoning from code syntax while preserving logical structure\n- 📊 Multi-Task Enhancement: Improves performance across symbolic, scientific, logic, mathematical, commonsense and code reasoning\n- ✨ Fully-Verifiable: Supports precise prediction verification through cached ground-truth matching or code re-execution\n- 🚀 Advanced Iteration: Enhanced version (CodeI\u002FO++) with multi-turn revision for better accuracy\n\n## Released Resources\n\n#### Dataset\n\n|Dataset|Link|\n|-|-|\n|CodeI\u002FO-PythonEdu-Reasoning|[🤗](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fhkust-nlp\u002FCodeIO-Pyedu-Reasoning)|\n|CodeI\u002FO-PythonEdu-Raw|[🤗](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fhkust-nlp\u002FCodeIO-PyEdu-Reasoning-Raw)|\n|LeetCode-O Benchmark|[🤗](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fhkust-nlp\u002FLeetCode-O)|\n\nDue to our collaborators' compliance requirements, we only release the PythonEdu-Reasoning subset of the CodeI\u002FO(++) dataset.\n\n\n\n#### Models\n\u003Ctable>\n    \u003Ctr>\n        \u003Cth rowspan=\"2\">Base Model \u002F Training\u003C\u002Fth>\n        \u003Cth colspan=\"2\">CodeI\u002FO\u003C\u002Fth>\n        \u003Cth colspan=\"2\">CodeI\u002FO++\u003C\u002Fth>\n    \u003C\u002Ftr>\n    \u003Ctr>\n        \u003Cth>Stage 1\u003C\u002Fth>\n        \u003Cth>Stage 2\u003C\u002Fth>\n        \u003Cth>Stage 1\u003C\u002Fth>\n        \u003Cth>Stage 2\u003C\u002Fth>\n    \u003C\u002Ftr>\n    \u003Ctr>\n        \u003Ctd>Qwen 2.5 7B Coder\u003C\u002Ftd>\n        \u003C!-- \u003Ctd style=\"background-color: #e6f3ff; text-align: center; vertical-align: middle;\">\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fhkust-nlp\u002Fqwen2.5-7b-coder_codeio_stage1\">Link\u003C\u002Fa>\u003C\u002Ftd> -->\n        \u003Ctd style=\"text-align: center; vertical-align: middle;\">\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fhkust-nlp\u002Fqwen2.5-7b-coder_codeio_stage1\">🤗\u003C\u002Fa>\u003C\u002Ftd>\n        \u003Ctd style=\"text-align: center; vertical-align: middle;\">\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fhkust-nlp\u002Fqwen2.5-7b-coder_codeio\">🤗\u003C\u002Fa>\u003C\u002Ftd>\n        \u003Ctd style=\"text-align: center; vertical-align: middle;\">\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fhkust-nlp\u002Fqwen2.5-7b-coder_codeio_pp_stage1\">🤗\u003C\u002Fa>\u003C\u002Ftd>\n        \u003Ctd style=\"text-align: center; vertical-align: middle;\">\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fhkust-nlp\u002Fqwen2.5-7b-coder_codeio_pp\">🤗\u003C\u002Fa>\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n        \u003Ctd>LLaMA 3.1 8B\u003C\u002Ftd>\n        \u003Ctd style=\"text-align: center; vertical-align: middle;\">\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fhkust-nlp\u002Fllama3.1-8b_codeio_stage1\">🤗\u003C\u002Fa>\u003C\u002Ftd>\n        \u003Ctd style=\"text-align: center; vertical-align: middle;\">\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fhkust-nlp\u002Fllama3.1-8b_codeio\">🤗\u003C\u002Fa>\u003C\u002Ftd>\n        \u003Ctd style=\"text-align: center; vertical-align: middle;\">\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fhkust-nlp\u002Fllama3.1-8b_codeio_pp_stage1\">🤗\u003C\u002Fa>\u003C\u002Ftd>\n        \u003Ctd style=\"text-align: center; vertical-align: middle;\">\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fhkust-nlp\u002Fllama3.1-8b_codeio_pp\">🤗\u003C\u002Fa>\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n        \u003Ctd>DeepSeek v2 Lite Coder\u003C\u002Ftd>\n        \u003Ctd style=\"text-align: center; vertical-align: middle;\">\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fhkust-nlp\u002Fdsv2-lite-coder_codeio_stage1\">🤗\u003C\u002Fa>\u003C\u002Ftd>\n        \u003Ctd style=\"text-align: center; vertical-align: middle;\">\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fhkust-nlp\u002Fdsv2-lite-coder_codeio\">🤗\u003C\u002Fa>\u003C\u002Ftd>\n        \u003Ctd style=\"text-align: center; vertical-align: middle;\">\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fhkust-nlp\u002Fdsv2-lite-coder_codeio_pp_stage1\">🤗\u003C\u002Fa>\u003C\u002Ftd>\n        \u003Ctd style=\"text-align: center; vertical-align: middle;\">\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fhkust-nlp\u002Fdsv2-lite-coder_codeio_pp\">🤗\u003C\u002Fa>\u003C\u002Ftd>\n    \u003C\u002Ftr>\n\u003C\u002Ftable>\n\n\n## Get Started\n\n### Setup\n\nWe provide both the `requirements.txt` and `environment.yaml`. You can choose either way to setup the environment.\n```\nconda create -n codeio_exec python 3.11\nconda activate codeio_exec\npip install -r requirements.txt\n```\nor\n```\nconda env create -f environment.yaml --name codeio_exec\nconda activate codeio_exec\n```\nPlease note that our setup does not guarantee the execution of all types of Python code; you may need to update the environment to meet your personal requirements when processing different code files.\n\n### Data Processing\n\nWe provide a complete guide for you to build data for CodeI\u002FO on a toy dataset. After all these steps you can get a dataset with the same format as in our [huggingface dataset](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fhkust-nlp\u002FCodeIO-Pyedu-Reasoning).\n\nAll intermediate results will be stored under `.\u002Fdata`, but we have also provided a set of pre-processed files under `.\u002Fprocessed_data`.\n\n#### Step 1: Convert raw code files into the unified format.\n\n##### Step 1.1: Build Messages\n```\npython .\u002Fsrc\u002Fbuild_transform_msg.py \\\n--raw_code_file data\u002Frawcode_1k.jsonl \\\n--raw_code_msg_file data\u002Frawcode_1k_msg.jsonl\n```\n##### Step 1.2: Inference\n```\npython .\u002Fsrc\u002Fbatched_api_inference.py \\\n--input data\u002Frawcode_1k_msg.jsonl \\\n--output data\u002Frawcode_1k_unified.jsonl \\\n--model deepseek-chat \\\n--num_process 10 \\\n--num_thread 10 \\\n--key \u003Cyour key> \\\n--temperature 0.7 \\\n--max_tokens 4096\n```\nYou can also use GPT series models to do this transformation step, since recently the DeepSeek API is under heavy pressure. For example, set `--model` as `gpt-4o-mini-2024-07-18​` and change `--key` accordingly.\nYou may find some the requests failed, it's OK and we just skip them.\n\n*Note that we only provide the code to inference with OpenAI-style APIs. However, it is also 100\\% feasible to deploy other open-source models and inference locally via frameworks like [vllm](https:\u002F\u002Fgithub.com\u002Fvllm-project\u002Fvllm) or [sglang](https:\u002F\u002Fgithub.com\u002Fsgl-project\u002Fsglang). Please refer to their official websites for more details.\n#### Step 2: Parse & Generate I\u002FO Pairs\n```\npython .\u002Fsrc\u002Fparse_gen_ios.py \\\n--input_file data\u002Frawcode_1k_unified.jsonl \\\n--output_file data\u002Frawcode_1k_parsed.jsonl \\\n--python_path \"python\" \\\n--run_path \".\u002Ftemp\u002Ftemp\u002Ftemp\"\n```\nThe `--python_path` is the python path you will use to run the I\u002FO pair generation code, which can be different from what you use in the main workflow, e.g., installed with some specific packages. The `--run_path` is the path where the I\u002FO pair generation code will be executed, since sometimes it will store some temp files in the file systems, so we explicitly assign a place for it to save them.\n\n#### Step 3: Build Input-Output Prediction Instances\nWe only pick 3 input prediction and 3 output prediction instances for each sample.\n```\npython .\u002Fsrc\u002Fbuild_codeio_msg.py \\\n--input_file data\u002Frawcode_1k_parsed.jsonl \\\n--output_file data\u002Fcodeio_1k_msg.jsonl\n```\n\n#### Step 4: Inference on CodeI\u002FO data\n```\npython .\u002Fsrc\u002Fbatched_api_inference.py \\\n--input data\u002Fcodeio_1k_msg.jsonl \\\n--output data\u002Fcodeio_1k_gens.jsonl \\\n--model deepseek-chat \\\n--num_process 10 \\\n--num_thread 10 \\\n--key \u003Cyour key> \\\n--temperature 0.7 \\\n--max_tokens 4096\n```\n#### Step 5: Verification\n```\nbash .\u002Fscripts\u002Fpipeline_check.sh \\\ndata\u002Frawcode_1k_parsed.jsonl \\\ndata\u002Fcodeio_1k_gens.jsonl \\\ndata\u002Fcodeio_1k_gens_verified.jsonl \\\npython \\\n.\u002Ftemp\u002Ftemp\u002Ftemp\n```\nIn the bash script we run the verification for several times to try our best avoid the runtime effect brought by multi-processing execution (e.g. timeout). This is helpful for large scale verification. You can change the number of process to match your machine (e.g. more if you have a large number of CPUs and a large memory).\n\n#### Step 6: Second Turn - Revision and Re-verification\n##### Step 6.1: Build Multi-turn Messages\n```\npython .\u002Fsrc\u002Fbuild_codeio_rev_msg.py \\\n--input_file data\u002Fcodeio_1k_gens_verified.jsonl \\\n--output_file data\u002Fcodeio_1k_msg_rev.jsonl\n```\n##### Step 6.2: Re-generate\n```\npython .\u002Fsrc\u002Fbatched_api_inference.py \\\n--input data\u002Fcodeio_1k_msg_rev.jsonl \\\n--output data\u002Fcodeio_1k_gens_rev.jsonl \\\n--model deepseek-chat \\\n--num_process 10 \\\n--num_thread 10 \\\n--key \u003Cyour key> \\\n--temperature 0.7 \\\n--max_tokens 4096\n```\n##### Step 6.3: Re-verification\n```\nbash .\u002Fscripts\u002Fpipeline_check.sh \\\ndata\u002Frawcode_1k_parsed.jsonl \\\ndata\u002Fcodeio_1k_gens_rev.jsonl \\\ndata\u002Fcodeio_1k_gens_rev_verified.jsonl \\\npython \\\n.\u002Ftemp\u002Ftemp\u002Ftemp\n```\n##### Step 6.4: Final Data\n```\npython .\u002Fsrc\u002Fassemble_codeio_demo.py \\\n--result_file_turn1 data\u002Fcodeio_1k_gens_verified.jsonl \\\n--result_file_turn2 data\u002Fcodeio_1k_gens_rev_verified.jsonl \\\n--output_file codeio_demo_final.jsonl\n```\nBy doing so, you can get data `data\u002Fcodeio_demo_final.jsonl` with the same format as in our [huggingface dataset](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fhkust-nlp\u002FCodeIO-Pyedu-Reasoning).\n\n### Training\nYou can use any popular training framework to train your model like [llama-factory](https:\u002F\u002Fgithub.com\u002Fhiyouga\u002FLLaMA-Factory). \n\n## Citation\nIf you find this work helpful, please kindly cite as:\n```\n@article{li2025codeio,\n  title={CodeI\u002FO: Condensing Reasoning Patterns via Code Input-Output Prediction},\n  author={Li, Junlong and Guo, Daya and Yang, Dejian and Xu, Runxin and Wu, Yu and He, Junxian},\n  journal={arXiv preprint arXiv:2502.07316},\n  year={2025}\n}\n```\n\n## Acknowledgement\nWe thank Fan Zhou, Wei Liu and Yiheng Xu for their valuable feedback and suggestions! 🤗🤗🤗\n","# CodeI\u002FO：通过代码输入-输出预测凝练推理模式\n\n\u003Cp align=\"center\">\n    📑 \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fpapers\u002F2502.07316\" target=\"_blank\">论文\u003C\u002Fa> &nbsp&nbsp | &nbsp&nbsp 🌐 \u003Ca href=\"https:\u002F\u002Fcodei-o.github.io\u002F\" target=\"_blank\">项目主页\u003C\u002Fa> &nbsp&nbsp | &nbsp&nbsp 🤗 \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fcollections\u002Fhkust-nlp\u002Fcodei-o-67a978e28fd926b56a4f55a2\" target=\"_blank\">已发布资源\u003C\u002Fa> &nbsp&nbsp | &nbsp&nbsp 💾 \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fhkust-nlp\u002FCodeIO-PyEdu-Reasoning\" target=\"_blank\">数据集\u003C\u002Fa> &nbsp&nbsp | &nbsp&nbsp 📦 \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fhkust-nlp\u002FCodeIO\" target=\"_blank\">仓库\u003C\u002Fa>  \n\u003Cbr>\n\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fhkust-nlp_CodeIO_readme_fc8b065a237d.png\" type=\"image\u002Fjpg\"\u002F>\n\u003Cp>\n\n## 目录\n\n- [简介](#Introduction)\n- [已发布资源](#Released-Resources)\n  - [数据集](#Dataset)\n  - [模型](#Models)\n- [开始使用](#Get-Started)\n  - [环境搭建](#Setup)\n  - [数据处理](#Data-Processing)\n  - [训练](#Training)\n- [引用](#Citation)\n- [致谢](#Acknowledgement)\n\n## 简介\nCodeI\u002FO 是一种新颖的方法，它将基于代码的推理模式转换为自然语言格式，以增强大型语言模型的推理能力。与专注于特定技能的传统方法不同，我们的方法系统地提取通用的推理原语，同时保持程序化的严谨性，从而在各种推理任务中实现更好的性能。\n\n**关键特性与贡献**\n- 🔄 通用转换：将多样化的代码模式转换为自然语言的思维链推理过程。\n- 🧠 语法解耦：在保留逻辑结构的同时，将推理从代码语法中解耦出来。\n- 📊 多任务提升：在符号推理、科学推理、逻辑推理、数学推理、常识推理和代码推理等多个任务上均能提升性能。\n- ✨ 完全可验证：支持通过缓存的真值匹配或代码重新执行来进行精确的预测验证。\n- 🚀 高级迭代：增强版（CodeI\u002FO++）具备多轮修正功能，以进一步提高准确性。\n\n## 已发布资源\n\n#### 数据集\n\n|数据集|链接|\n|-|-|\n|CodeI\u002FO-PythonEdu-Reasoning|[🤗](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fhkust-nlp\u002FCodeIO-Pyedu-Reasoning)|\n|CodeI\u002FO-PythonEdu-Raw|[🤗](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fhkust-nlp\u002FCodeIO-PyEdu-Reasoning-Raw)|\n|LeetCode-O 基准测试|[🤗](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fhkust-nlp\u002FLeetCode-O)|\n\n由于合作方的合规要求，我们仅发布了 CodeI\u002FO(++) 数据集中 PythonEdu-Reasoning 子集。\n\n\n\n#### 模型\n\u003Ctable>\n    \u003Ctr>\n        \u003Cth rowspan=\"2\">基础模型 \u002F 训练\u003C\u002Fth>\n        \u003Cth colspan=\"2\">CodeI\u002FO\u003C\u002Fth>\n        \u003Cth colspan=\"2\">CodeI\u002FO++\u003C\u002Fth>\n    \u003C\u002Ftr>\n    \u003Ctr>\n        \u003Cth>阶段1\u003C\u002Fth>\n        \u003Cth>阶段2\u003C\u002Fth>\n        \u003Cth>阶段1\u003C\u002Fth>\n        \u003Cth>阶段2\u003C\u002Fth>\n    \u003C\u002Ftr>\n    \u003Ctr>\n        \u003Ctd>Qwen 2.5 7B Coder\u003C\u002Ftd>\n        \u003C!-- \u003Ctd style=\"background-color: #e6f3ff; text-align: center; vertical-align: middle;\">\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fhkust-nlp\u002Fqwen2.5-7b-coder_codeio_stage1\">链接\u003C\u002Fa>\u003C\u002Ftd> -->\n        \u003Ctd style=\"text-align: center; vertical-align: middle;\">\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fhkust-nlp\u002Fqwen2.5-7b-coder_codeio_stage1\">🤗\u003C\u002Fa>\u003C\u002Ftd>\n        \u003Ctd style=\"text-align: center; vertical-align: middle;\">\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fhkust-nlp\u002Fqwen2.5-7b-coder_codeio\">🤗\u003C\u002Fa>\u003C\u002Ftd>\n        \u003Ctd style=\"text-align: center; vertical-align: middle;\">\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fhkust-nlp\u002Fqwen2.5-7b-coder_codeio_pp_stage1\">🤗\u003C\u002Fa>\u003C\u002Ftd>\n        \u003Ctd style=\"text-align: center; vertical-align: middle;\">\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fhkust-nlp\u002Fqwen2.5-7b-coder_codeio_pp\">🤗\u003C\u002Fa>\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n        \u003Ctd>LLaMA 3.1 8B\u003C\u002Ftd>\n        \u003Ctd style=\"text-align: center; vertical-align: middle;\">\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fhkust-nlp\u002Fllama3.1-8b_codeio_stage1\">🤗\u003C\u002Fa>\u003C\u002Ftd>\n        \u003Ctd style=\"text-align: center; vertical-align: middle;\">\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fhkust-nlp\u002Fllama3.1-8b_codeio\">🤗\u003C\u002Fa>\u003C\u002Ftd>\n        \u003Ctd style=\"text-align: center; vertical-align: middle;\">\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fhkust-nlp\u002Fllama3.1-8b_codeio_pp_stage1\">🤗\u003C\u002Fa>\u003C\u002Ftd>\n        \u003Ctd style=\"text-align: center; vertical-align: middle;\">\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fhkust-nlp\u002Fllama3.1-8b_codeio_pp\">🤗\u003C\u002Fa>\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n        \u003Ctd>DeepSeek v2 Lite Coder\u003C\u002Ftd>\n        \u003Ctd style=\"text-align: center; vertical-align: middle;\">\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fhkust-nlp\u002Fdsv2-lite-coder_codeio_stage1\">🤗\u003C\u002Fa>\u003C\u002Ftd>\n        \u003Ctd style=\"text-align: center; vertical-align: middle;\">\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fhkust-nlp\u002Fdsv2-lite-coder_codeio\">🤗\u003C\u002Fa>\u003C\u002Ftd>\n        \u003Ctd style=\"text-align: center; vertical-align: middle;\">\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fhkust-nlp\u002Fdsv2-lite-coder_codeio_pp_stage1\">🤗\u003C\u002Fa>\u003C\u002Ftd>\n        \u003Ctd style=\"text-align: center; vertical-align: middle;\">\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fhkust-nlp\u002Fdsv2-lite-coder_codeio_pp\">🤗\u003C\u002Fa>\u003C\u002Ftd>\n    \u003C\u002Ftr>\n\u003C\u002Ftable>\n\n\n## 开始使用\n\n### 环境搭建\n\n我们提供了 `requirements.txt` 和 `environment.yaml` 两种方式来搭建环境。您可以选择其中任意一种方式进行设置。\n```\nconda create -n codeio_exec python 3.11\nconda activate codeio_exec\npip install -r requirements.txt\n```\n或者\n```\nconda env create -f environment.yaml --name codeio_exec\nconda activate codeio_exec\n```\n请注意，我们的环境配置并不能保证所有类型的 Python 代码都能顺利运行；在处理不同的代码文件时，您可能需要根据个人需求更新环境。\n\n### 数据处理\n\n我们提供了一份完整的指南，帮助您在玩具数据集上构建用于 CodeI\u002FO 的数据。完成所有步骤后，您将得到一个与我们的 [Hugging Face 数据集](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fhkust-nlp\u002FCodeIO-Pyedu-Reasoning) 格式相同的数据集。\n\n所有中间结果都将存储在 `.\u002Fdata` 目录下，同时我们也提供了一组预处理文件，位于 `.\u002Fprocessed_data` 目录中。\n\n#### 第一步：将原始代码文件转换为统一格式。\n\n##### 步骤 1.1：构建消息\n```\npython .\u002Fsrc\u002Fbuild_transform_msg.py \\\n--raw_code_file data\u002Frawcode_1k.jsonl \\\n--raw_code_msg_file data\u002Frawcode_1k_msg.jsonl\n```\n\n##### 步骤 1.2：推理\n```\npython .\u002Fsrc\u002Fbatched_api_inference.py \\\n--input data\u002Frawcode_1k_msg.jsonl \\\n--output data\u002Frawcode_1k_unified.jsonl \\\n--model deepseek-chat \\\n--num_process 10 \\\n--num_thread 10 \\\n--key \u003Cyour key> \\\n--temperature 0.7 \\\n--max_tokens 4096\n```\n\n您也可以使用 GPT 系列模型来完成这一步的转换，因为最近 DeepSeek API 的压力较大。例如，将 `--model` 设置为 `gpt-4o-mini-2024-07-18​`，并相应地更改 `--key`。您可能会遇到一些请求失败的情况，这没有关系，我们可以直接跳过这些请求。\n\n*请注意，我们仅提供了使用 OpenAI 风格 API 进行推理的代码。然而，使用其他开源模型并通过 [vllm](https:\u002F\u002Fgithub.com\u002Fvllm-project\u002Fvllm) 或 [sglang](https:\u002F\u002Fgithub.com\u002Fsgl-project\u002Fsglang) 等框架在本地进行推理也是完全可行的。更多详情请参考它们的官方网站。\n#### 第二步：解析并生成 I\u002FO 对\n```\npython .\u002Fsrc\u002Fparse_gen_ios.py \\\n--input_file data\u002Frawcode_1k_unified.jsonl \\\n--output_file data\u002Frawcode_1k_parsed.jsonl \\\n--python_path \"python\" \\\n--run_path \".\u002Ftemp\u002Ftemp\u002Ftemp\"\n```\n\n其中，`--python_path` 是您用于运行 I\u002FO 对生成代码的 Python 路径，它可以与您在主工作流中使用的路径不同，比如安装了某些特定的包。而 `--run_path` 则是 I\u002FO 对生成代码执行时的工作目录，因为有时它会在文件系统中存储一些临时文件，所以我们特意为其指定了一个保存位置。\n\n#### 第三步：构建输入-输出预测实例\n我们为每个样本只选取 3 个输入预测和 3 个输出预测实例。\n```\npython .\u002Fsrc\u002Fbuild_codeio_msg.py \\\n--input_file data\u002Frawcode_1k_parsed.jsonl \\\n--output_file data\u002Fcodeio_1k_msg.jsonl\n```\n\n#### 第四步：对 CodeI\u002FO 数据进行推理\n```\npython .\u002Fsrc\u002Fbatched_api_inference.py \\\n--input data\u002Fcodeio_1k_msg.jsonl \\\n--output data\u002Fcodeio_1k_gens.jsonl \\\n--model deepseek-chat \\\n--num_process 10 \\\n--num_thread 10 \\\n--key \u003Cyour key> \\\n--temperature 0.7 \\\n--max_tokens 4096\n```\n\n#### 第五步：验证\n```\nbash .\u002Fscripts\u002Fpipeline_check.sh \\\ndata\u002Frawcode_1k_parsed.jsonl \\\ndata\u002Fcodeio_1k_gens.jsonl \\\ndata\u002Fcodeio_1k_gens_verified.jsonl \\\npython \\\n.\u002Ftemp\u002Ftemp\u002Ftemp\n```\n\n在该 Bash 脚本中，我们会多次运行验证过程，以尽量避免多进程执行带来的运行时影响（如超时）。这对于大规模验证非常有帮助。您可以根据自己的机器配置调整进程数量（例如，如果您的 CPU 数量较多且内存充足，可以适当增加）。\n\n#### 第六步：第二轮——修订与再验证\n##### 步骤 6.1：构建多轮消息\n```\npython .\u002Fsrc\u002Fbuild_codeio_rev_msg.py \\\n--input_file data\u002Fcodeio_1k_gens_verified.jsonl \\\n--output_file data\u002Fcodeio_1k_msg_rev.jsonl\n```\n\n##### 步骤 6.2：重新生成\n```\npython .\u002Fsrc\u002Fbatched_api_inference.py \\\n--input data\u002Fcodeio_1k_msg_rev.jsonl \\\n--output data\u002Fcodeio_1k_gens_rev.jsonl \\\n--model deepseek-chat \\\n--num_process 10 \\\n--num_thread 10 \\\n--key \u003Cyour key> \\\n--temperature 0.7 \\\n--max_tokens 4096\n```\n\n##### 步骤 6.3：再验证\n```\nbash .\u002Fscripts\u002Fpipeline_check.sh \\\ndata\u002Frawcode_1k_parsed.jsonl \\\ndata\u002Fcodeio_1k_gens_rev.jsonl \\\ndata\u002Fcodeio_1k_gens_rev_verified.jsonl \\\npython \\\n.\u002Ftemp\u002Ftemp\u002Ftemp\n```\n\n##### 步骤 6.4：最终数据\n```\npython .\u002Fsrc\u002Fassemble_codeio_demo.py \\\n--result_file_turn1 data\u002Fcodeio_1k_gens_verified.jsonl \\\n--result_file_turn2 data\u002Fcodeio_1k_gens_rev_verified.jsonl \\\n--output_file codeio_demo_final.jsonl\n```\n\n通过以上步骤，您将获得与我们的 [Hugging Face 数据集](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fhkust-nlp\u002FCodeIO-Pyedu-Reasoning) 格式相同的数据文件 `data\u002Fcodeio_demo_final.jsonl`。\n\n### 训练\n您可以使用任何流行的训练框架来训练您的模型，例如 [llama-factory](https:\u002F\u002Fgithub.com\u002Fhiyouga\u002FLLaMA-Factory)。\n\n## 引用\n如果您觉得这项工作对您有所帮助，请引用如下：\n```\n@article{li2025codeio,\n  title={CodeI\u002FO: Condensing Reasoning Patterns via Code Input-Output Prediction},\n  author={Li, Junlong and Guo, Daya and Yang, Dejian and Xu, Runxin and Wu, Yu and He, Junxian},\n  journal={arXiv preprint arXiv:2502.07316},\n  year={2025}\n}\n```\n\n## 致谢\n我们感谢 Fan Zhou、Wei Liu 和 Yiheng Xu 提供的宝贵反馈和建议！ 🤗🤗🤗","# CodeIO 快速上手指南\n\nCodeIO 是一种将代码推理模式转化为自然语言思维链（Chain-of-Thought）的新方法，旨在提升大语言模型在符号、科学、逻辑、数学及代码推理等多任务上的表现。本指南帮助开发者快速搭建环境并处理数据。\n\n## 环境准备\n\n*   **操作系统**: Linux \u002F macOS (Windows 需使用 WSL)\n*   **Python 版本**: 3.11\n*   **依赖管理**: Conda (推荐) 或 Pip\n*   **硬件要求**: 建议具备多核 CPU 以加速数据处理过程中的并行执行；若进行本地模型训练或推理，需配备 NVIDIA GPU。\n\n## 安装步骤\n\n推荐使用 Conda 创建独立虚拟环境以避免依赖冲突。\n\n### 方式一：使用 requirements.txt (推荐)\n\n```bash\nconda create -n codeio_exec python=3.11\nconda activate codeio_exec\npip install -r requirements.txt\n```\n\n### 方式二：使用 environment.yaml\n\n```bash\nconda env create -f environment.yaml --name codeio_exec\nconda activate codeio_exec\n```\n\n> **注意**：默认环境可能无法执行所有类型的 Python 代码。若处理特定依赖的代码文件，请根据需要在环境中额外安装相关包。\n\n## 基本使用：数据处理流程\n\nCodeIO 的核心工作流是将原始代码转换为统一的推理数据格式。以下基于官方提供的玩具数据集（toy dataset）演示完整流程，生成的数据格式与 HuggingFace 发布的 `CodeIO-PyEdu-Reasoning` 一致。\n\n所有中间结果将保存在 `.\u002Fdata` 目录，预处理文件位于 `.\u002Fprocessed_data`。\n\n### 第一步：统一代码格式\n\n**1.1 构建消息格式**\n将原始代码文件转换为统一的消息格式。\n```bash\npython .\u002Fsrc\u002Fbuild_transform_msg.py \\\n--raw_code_file data\u002Frawcode_1k.jsonl \\\n--raw_code_msg_file data\u002Frawcode_1k_msg.jsonl\n```\n\n**1.2 模型推理转换**\n调用 API 将代码逻辑转换为自然语言描述。默认使用 DeepSeek，也可替换为 GPT-4o 等模型（需修改 `--model` 和 `--key`）。\n```bash\npython .\u002Fsrc\u002Fbatched_api_inference.py \\\n--input data\u002Frawcode_1k_msg.jsonl \\\n--output data\u002Frawcode_1k_unified.jsonl \\\n--model deepseek-chat \\\n--num_process 10 \\\n--num_thread 10 \\\n--key \u003Cyour key> \\\n--temperature 0.7 \\\n--max_tokens 4096\n```\n*注：支持使用 vllm 或 sglang 部署本地开源模型进行推理，只需调整调用脚本即可。*\n\n### 第二步：解析并生成输入\u002F输出对 (I\u002FO Pairs)\n\n执行代码以提取输入输出样本。需指定 Python 解释器路径和临时文件运行路径。\n```bash\npython .\u002Fsrc\u002Fparse_gen_ios.py \\\n--input_file data\u002Frawcode_1k_unified.jsonl \\\n--output_file data\u002Frawcode_1k_parsed.jsonl \\\n--python_path \"python\" \\\n--run_path \".\u002Ftemp\u002Ftemp\u002Ftemp\"\n```\n\n### 第三步：构建 CodeIO 预测实例\n\n从解析结果中筛选样本，每个样本选取 3 个输入预测和 3 个输出预测实例。\n```bash\npython .\u002Fsrc\u002Fbuild_codeio_msg.py \\\n--input_file data\u002Frawcode_1k_parsed.jsonl \\\n--output_file data\u002Fcodeio_1k_msg.jsonl\n```\n\n### 第四步：生成推理结果\n\n对构建好的 CodeIO 数据进行推理生成。\n```bash\npython .\u002Fsrc\u002Fbatched_api_inference.py \\\n--input data\u002Fcodeio_1k_msg.jsonl \\\n--output data\u002Fcodeio_1k_gens.jsonl \\\n--model deepseek-chat \\\n--num_process 10 \\\n--num_thread 10 \\\n--key \u003Cyour key> \\\n--temperature 0.7 \\\n--max_tokens 4096\n```\n\n### 第五步：验证结果\n\n运行脚本验证生成结果的准确性。脚本会多次运行以规避多进程导致的超时问题。\n```bash\nbash .\u002Fscripts\u002Fpipeline_check.sh \\\ndata\u002Frawcode_1k_parsed.jsonl \\\ndata\u002Fcodeio_1k_gens.jsonl \\\ndata\u002Fcodeio_1k_gens_verified.jsonl \\\npython \\\n.\u002Ftemp\u002Ftemp\u002Ftemp\n```\n\n### 第六步：多轮修订与最终组装 (CodeI\u002FO++)\n\n为了获得更高精度（CodeI\u002FO++），可进行第二轮修订和重新验证。\n\n**6.1 构建多轮消息**\n```bash\npython .\u002Fsrc\u002Fbuild_codeio_rev_msg.py \\\n--input_file data\u002Fcodeio_1k_gens_verified.jsonl \\\n--output_file data\u002Fcodeio_1k_msg_rev.jsonl\n```\n\n**6.2 重新生成**\n```bash\npython .\u002Fsrc\u002Fbatched_api_inference.py \\\n--input data\u002Fcodeio_1k_msg_rev.jsonl \\\n--output data\u002Fcodeio_1k_gens_rev.jsonl \\\n--model deepseek-chat \\\n--num_process 10 \\\n--num_thread 10 \\\n--key \u003Cyour key> \\\n--temperature 0.7 \\\n--max_tokens 4096\n```\n\n**6.3 重新验证**\n```bash\nbash .\u002Fscripts\u002Fpipeline_check.sh \\\ndata\u002Frawcode_1k_parsed.jsonl \\\ndata\u002Fcodeio_1k_gens_rev.jsonl \\\ndata\u002Fcodeio_1k_gens_rev_verified.jsonl \\\npython \\\n.\u002Ftemp\u002Ftemp\u002Ftemp\n```\n\n**6.4 组装最终数据**\n合并两轮结果，生成最终数据集。\n```bash\npython .\u002Fsrc\u002Fassemble_codeio_demo.py \\\n--result_file_turn1 data\u002Fcodeio_1k_gens_verified.jsonl \\\n--result_file_turn2 data\u002Fcodeio_1k_gens_rev_verified.jsonl \\\n--output_file codeio_demo_final.jsonl\n```\n\n执行完毕后，`codeio_demo_final.jsonl` 即为可用于训练的最终格式数据。您可以使用 [LLaMA-Factory](https:\u002F\u002Fgithub.com\u002Fhiyouga\u002FLLaMA-Factory) 等主流框架加载该数据进行模型微调。","某教育科技公司的算法工程师正在开发一个智能编程辅导系统，旨在自动批改学生提交的 Python 作业并生成详细的解题思路反馈。\n\n### 没有 CodeIO 时\n- **推理逻辑黑盒化**：模型直接输出代码或最终答案，缺乏中间推导步骤，学生无法理解“为什么这样写”，只能照抄结果。\n- **语法与逻辑强耦合**：模型过度依赖特定代码语法结构进行推理，一旦学生代码风格变化或存在细微语法错误，逻辑判断即刻失效。\n- **跨领域泛化能力弱**：在处理非纯代码类的逻辑题（如数学应用题转代码）时，模型难以提取通用的推理模式，导致准确率大幅下降。\n- **结果不可验证**：生成的解题思路模糊不清，系统无法通过重新执行代码或匹配标准答案来精确验证推理过程的正确性。\n\n### 使用 CodeIO 后\n- **思维链显性化**：CodeIO 将代码背后的推理模式转化为自然的语言思维链（Chain-of-Thought），清晰展示从问题分析到逻辑构建的全过程。\n- **逻辑与语法解耦**：通过剥离具体语法干扰，CodeIO 让模型专注于核心逻辑结构，即使面对格式不规范的学生代码也能准确识别推理意图。\n- **多任务性能提升**：借助通用推理原语的提取，系统在科学计算、逻辑谜题及数学建模等混合任务中的表现显著增强，不再局限于单一编码场景。\n- **全流程可验证**：利用 CodeIO 支持的缓存真值匹配或代码重执行机制，系统能精准校验每一步推理的正确性，确保反馈内容零幻觉。\n\nCodeIO 通过将隐式的代码推理转化为显式、可验证的自然语言逻辑，彻底解决了智能辅导系统中“只给答案不讲逻辑”的核心痛点。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fhkust-nlp_CodeIO_8251e5ab.png","hkust-nlp","NLP Group @ HKUST","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fhkust-nlp_83897fa3.jpg","We are a group of NLP researchers in the Hong Kong University of Science and Technology",null,"https:\u002F\u002Fjxhe.github.io\u002Fgroup\u002F","https:\u002F\u002Fgithub.com\u002Fhkust-nlp",[83,87],{"name":84,"color":85,"percentage":86},"Python","#3572A5",98.6,{"name":88,"color":89,"percentage":90},"Shell","#89e051",1.4,568,32,"2026-03-30T04:40:54","未说明","未说明（训练建议使用主流框架如 LLaMA-Factory，推理支持本地部署 vLLM 或 SGLang，具体显存需求取决于所选基座模型大小，如 7B 或 8B）","未说明（数据处理阶段涉及多进程执行，建议根据 CPU 核心数和数据集规模配置较大内存）",{"notes":98,"python":99,"dependencies":100},"1. 环境搭建推荐使用 conda，官方提供了 requirements.txt 和 environment.yaml 两种方案。\n2. 数据处理步骤需要调用外部 API（如 DeepSeek 或 OpenAI）进行代码转换和推理，需准备相应的 API Key。\n3. 若选择本地部署开源模型进行推理，需自行安装 vLLM 或 SGLang 框架。\n4. 运行 I\u002FO 对生成和验证脚本时，需指定具体的 Python 路径和执行目录，且环境需支持执行各类 Python 代码。\n5. 验证阶段采用多进程运行以规避超时问题，可根据机器配置调整进程数量。","3.11",[101,102],"requirements.txt (具体列表未展示)","environment.yaml (具体列表未展示)",[26,13],"2026-03-27T02:49:30.150509","2026-04-06T06:44:47.538560",[107,112,117,122,127,132,137,142],{"id":108,"question_zh":109,"answer_zh":110,"source_url":111},12210,"如何在 LLaMA-Factory 中配置多轮微调的数据集格式？","可以将数据集中的 `prompt` 字段映射为 `input`，然后将 `turn_1`, `feedback_1`, `turn_2`, `feedback_2` 拼接成一个长序列作为 `output`。为了使过渡平滑，建议在拼接时添加一些模板字符串（参考论文中的 Table 9）。具体而言，在 `dataset_info.json` 中定义列映射，例如：`\"columns\": {\"prompt\": \"question\", \"response\": \"turn_1\", ...}`，并在数据处理时将多轮对话内容合并。","https:\u002F\u002Fgithub.com\u002Fhkust-nlp\u002FCodeIO\u002Fissues\u002F1",{"id":113,"question_zh":114,"answer_zh":115,"source_url":116},12211,"运行 parse_gen_ios.py 时出现 'eulerlib_prefix' 未定义的错误怎么办？","这是因为缺少数学相关的包导入。首先运行 `pip install eulerlib` 安装依赖，然后在代码中定义该变量为：`eulerlib_prefix = \"from eulerlib import *\"`。这样即可解决 NameError 问题。","https:\u002F\u002Fgithub.com\u002Fhkust-nlp\u002FCodeIO\u002Fissues\u002F2",{"id":118,"question_zh":119,"answer_zh":120,"source_url":121},12212,"为什么每个样本只有 3 对输入输出，最终生成的实例总数却远超 900K？","统计时将“输入预测实例”和“输出预测实例”分开计算。总实例数计算公式为：300K * 2.78 (平均输入实例) + 300K * 2.80 (平均输出实例) ≈ 1,674K。因此总数会接近 167 万而不是 90 万。","https:\u002F\u002Fgithub.com\u002Fhkust-nlp\u002FCodeIO\u002Fissues\u002F3",{"id":123,"question_zh":124,"answer_zh":125,"source_url":126},12213,"环境配置时提示找不到 'hf3fs-py-fuse-io' 包如何解决？","该包并非必需，维护者已更新 requirements 文件移除了此依赖。如果遇到此错误，请拉取最新代码或直接忽略该包的安装错误，继续安装其他依赖即可。","https:\u002F\u002Fgithub.com\u002Fhkust-nlp\u002FCodeIO\u002Fissues\u002F6",{"id":128,"question_zh":129,"answer_zh":130,"source_url":131},12214,"执行步骤时提示找不到 'data\u002Fcodeio_1k_gens_verified.jsonl' 文件？","这通常是因为缺少必要的临时目录。请检查代码逻辑，确保在运行前创建了 `temp` 路径。如果问题依旧，建议更新仓库代码以获取修复后的版本。","https:\u002F\u002Fgithub.com\u002Fhkust-nlp\u002FCodeIO\u002Fissues\u002F5",{"id":133,"question_zh":134,"answer_zh":135,"source_url":136},12215,"DeepSeek API 调用成功率低或结果异常是否正常？","DeepSeek API 近期可能不稳定，导致成功率波动。如果输入输出对的成功率极低（如 580 个中仅 8 个成功），建议检查 `processed_data` 目录下的文件内容，并尝试自行重新运行验证。此外，确认使用的是本地部署版本还是官方 API，不同版本表现可能不同。","https:\u002F\u002Fgithub.com\u002Fhkust-nlp\u002FCodeIO\u002Fissues\u002F4",{"id":138,"question_zh":139,"answer_zh":140,"source_url":141},12216,"论文表 3 消融实验中“仅代码回复”的 Prompt 是什么？","使用的 Prompt 非常简单，格式为：\"please write a piece of python code to solve this problem: {query}\"，其中 `{query}` 替换为具体问题，模型仅需返回参考代码 `{reference code}`，不包含其他解释性文字。","https:\u002F\u002Fgithub.com\u002Fhkust-nlp\u002FCodeIO\u002Fissues\u002F7",{"id":143,"question_zh":144,"answer_zh":145,"source_url":146},12217,"是否提供用于复现结果的评估脚本（Evaluation Scripts）？","抱歉，目前的评估严重依赖公司内部的评估框架，作者无权公开发布这些脚本。用户可能需要根据论文描述自行构建评估流程。","https:\u002F\u002Fgithub.com\u002Fhkust-nlp\u002FCodeIO\u002Fissues\u002F11",[]]