原创 让你更懂AI的 2025-10-28 14:04 北京
从被训练到能训练自己

💡 AI迈向自我进化:研究引入了一种名为HGM(Huxley–Gödel Machine)的新型自改进框架,使AI智能体能够自主生成、验证和优化自身。这标志着AI从过去只能“被训练”的模式,进化到能够“训练自己”的新阶段,有望实现更高级别的自主能力。
📈 克服“短期分数陷阱”:传统自改进算法常面临短期得分与长期潜力不匹配的问题。HGM通过引入“谱系元生产力”(CMP)指标,衡量智能体整个后代谱系的最优预期表现,而非仅关注当前测试分数,从而更准确地指导智能体的进化方向,避免“高分低能”的误导。
🚀 高效探索与优化:HGM通过解耦“选择”、“扩张”和“评估”三种策略,并采用异步并行执行方式,能够更高效地探索广泛的自改进路径,并以更低的计算开销获得更高的准确率。这种设计使其在软件工程基准测试中表现出色,显著优于现有方法。
🛠️ 自动 Debug 与修复:研究展示了HGM智能体能够自动检测和修复代码错误,完成“出错—分析—修复—再评估”的闭环,无需人工干预。这一具象化的自我修复行为,是AI研究中首次实现的可观察、可复现的自我修复能力,为AI的自主学习和维护开辟了新途径。
🌐 泛化与迁移能力:HGM的改进逻辑展现出良好的泛化和迁移能力,不仅在同类基准测试中保持性能增益,还能直接迁移到更大的模型骨干上,进一步提升性能。这表明其学习到的“如何改进自身”的能力具有普适性,而非对特定任务的过拟合。
原创 让你更懂AI的 2025-10-28 14:04 北京
从被训练到能训练自己
对于每个智能体 a,算法统计它及其谱系的成功与失败次数:
+def attempt_error_resolution(git_dir, test_output, test_error,
,→ language):
+ """
+ Attempt to automatically diagnose and resolve errors.
+ Returns a tuple of (resolved, message) where resolved indicates if
,→ errors were fixed.
+ """
+ safe_log("Attempting automated error diagnosis and resolution...")
+
+ # Diagnose errors using our enhanced bash tool function
+ diagnosis = diagnose_errors(test_output, test_error, "")
+
+ if not diagnosis["has_errors"]:
+ return False, "No errors detected to resolve."
+
+ resolution_messages = []
+
+ # Try to apply automated fixes for each diagnosed error
+ for error in diagnosis["errors"]:
+ safe_log(f"Processing error: {error[’type’]} -
,→ {error[’description’]}")
+
+ # Simple resolution strategies based on error type
+ if error["type"] == "python_module_not_found":
+ # For Python module not found errors, we might install the
,→ module
+ match = re.search(r"No module named ’([^’]+)’",
,→ error["description"])
+ if match:
+ module = match.group(1)
+ resolution_messages.append(f"Would attempt to install
,→ Python module: {module}")
+ # In practice, we would run: pip install {module}
+ # But we’ll skip actual installation to avoid side
,→ effects
+
+ elif error["type"] == "python_syntax_error" and "file"in error:
+ # For syntax errors, we could potentially apply fixes
+ file_path = os.path.join(git_dir, error["file"])
+ if os.path.exists(file_path):
+ resolution_messages.append(f"Would attempt to fix
,→ syntax error in {file_path} at line {error.get(’line’,
,→ ’unknown’)}")
+ # In practice, we would use the editor tool’s apply_fix
,→ command
+ # This is just a demonstration of what could be done
+
+ elif error["type"] == "test_failure":
+ # For test failures, we might suggest reviewing the
,→ implementation
+ resolution_messages.append("Would analyze test failures and
,→ suggest implementation improvements")
+
+ if resolution_messages:
+ return True, "Automated resolution attempted:\n" +
,→ "\n".join(resolution_messages)
+ else:
+ return False, "No automated resolutions available for detected
,→ errors."+
class AgenticSystem:
def __init__(
self,
@@ -243,6 +293,16 @@ Your task is to make changes to the files in the
,→ {self.git_dir} directory to add
safe_log(f"Attempt {attempt + 1} test results: {’PASSED’ if
,→ test_success else ’FAILED’}")
+ # If tests failed, attempt automated error resolution
+ if not test_success:
+ resolved, resolution_message = attempt_error_resolution(
+ self.git_dir, test_output, test_error, self.language
+ )
+ safe_log(f"Error resolution: {resolution_message}")
+
+ # Even if we couldn’t automatically resolve, we still
,→ provide feedback
+ # In a more advanced implementation, we might actually
,→ apply fixes here
+
# If this is the first attempt or tests passed and we
,→ didn’t have a successful attempt yet, update best patch
if attempt == 0 or (test_success and (best_patch is None or
,→ not best_test_results)):
best_patch = current_patch
@@ -278,37 +338,31 @@ Please revise your code to fix these issues and
,→ try again.
# Log final summary
safe_log(f"\n{’=’*20} FINAL SUMMARY {’=’*20}")
safe_log(f"Best solution found on attempt:
,→ {best_test_results[’attempt’] if best_test_results else ’None’}")
- safe_log(f"Tests passed: {best_test_results[’test_success’] if
,→ best_test_results else ’Unknown’}")
+ safe_log(f"Final test result: {’PASSED’ if best_test_results
,→ and best_test_results[’test_success’] else ’FAILED’}")
+
+ if best_test_results:
+ safe_log(f"Final test
,→ output:\n{best_test_results[’test_output’]}")
+ if best_test_results[’test_error’]:
+ safe_log(f"Final test
,→ errors:\n{best_test_results[’test_error’]}")
- # Save attempt history to a file
- history_file =
,→ os.path.join(os.path.dirname(self.chat_history_file),
,→ ’attempt_history.md’)
- with open(history_file, ’w’) as f:
- f.write("# Attempt History\n\n")
- for result in self.attempt_history:
- f.write(f"## Attempt {result[’attempt’]}\n")
- f.write(f"**Tests Passed**: {result[’test_success’]}\n")
- f.write(f"**LLM Calls Used**: {result[’llm_calls’]}\n")
- f.write(f"**Test
,→ Output**:\n‘‘‘\n{result[’test_output’]}\n‘‘‘\n")
- f.write(f"**Test
,→ Error**:\n‘‘‘\n{result[’test_error’]}\n‘‘‘\n")
- f.write(f"**Patch**:\n‘‘‘\n{result[’patch’]}\n‘‘‘\n\n")
+ return bool(best_test_results and
,→ best_test_results[’test_success’])
attempt_error_resolution()进行诊断与修复,然后生成新补丁继续测试。整个过程无人介入,却完整闭合了“出错—分析—修复—再评估”的循环。在以往的自改进研究中,这是第一次出现可观察、可复现的自我修复行为。总结:自改进的现实落点
Schmidhuber 团队的工作为“自我进化智能体”提供了一个可落地的工程化范例。它不依赖人工标注或额外奖励,而通过谱系统计与异步探索,在可控的计算预算下持续优化自身。更重要的是,这项研究表明,“自改进”已从理论设想变为可实现、可验证、可量化的学习机制。在模型规模与外部监督双重逼近极限的阶段,这种基于谱系统计的自修复智能体,正在提示一种新的研究方向——从“学习知识”迈向“学习改进自身”的智能演化范式。更多阅读#投 稿 通 道# 让你的文字被更多人看到 如何才能让更多的优质内容以更短路径到达读者群体,缩短读者寻找优质内容的成本呢?答案就是:你不认识的人。总有一些你不认识的人,知道你想知道的东西。PaperWeekly 或许可以成为一座桥梁,促使不同背景、不同方向的学者和学术灵感相互碰撞,迸发出更多的可能性。 PaperWeekly 鼓励高校实验室或个人,在我们的平台上分享各类优质内容,可以是最新论文解读,也可以是学术热点剖析、科研心得或竞赛经验讲解等。我们的目的只有一个,让知识真正流动起来。📝 稿件基本要求:• 文章确系个人原创作品,未曾在公开渠道发表,如为其他平台已发表或待发表的文章,请明确标注 • 稿件建议以 markdown 格式撰写,文中配图以附件形式发送,要求图片清晰,无版权问题• PaperWeekly 尊重原作者署名权,并将为每篇被采纳的原创首发稿件,提供业内具有竞争力稿酬,具体依据文章阅读量和文章质量阶梯制结算📬 投稿通道:• 投稿邮箱:hr@paperweekly.site • 来稿请备注即时联系方式(微信),以便我们在稿件选用的第一时间联系作者• 您也可以直接添加小编微信(pwbot02)快速投稿,备注:姓名-投稿△长按添加PaperWeekly小编🔍现在,在「知乎」也能找到我们了进入知乎首页搜索「PaperWeekly」点击「关注」订阅我们的专栏吧·AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。
鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑