This is a viewer only at the moment see the article on how this works.
To update the preview hit Ctrl-Alt-R (or ⌘-Alt-R on Mac) or Enter to refresh. The Save icon lets you save the markdown file to disk
This is a preview from the server running through my markdig pipeline
Thursday, 13 November 2025
当系统开始重写自己的代码时
注: 灵感来源于思考将大部分Lucid.mockllmapi及材料扩展至(从未公布过,
我们见过简单的规则 创造了复杂的行为。我们见过通信 创造了集体智慧。
现在,我们迈出让我深感不安的一步:
如果系统能够 改写自己的规则?
如果代理商能够:
这不仅仅是优化,这是 自我自编.
一旦你给了一个系统 自我改善的能力... 它在哪里停止?
进化是最终自我优化的系统:
没有智能设计师 没有计划 只是简单的算法
现在想象同样的模式,但用人工智能剂代替生物体。而不是数十亿年,而是在数天或数周内发生。
在我们走得更远之前,让我们在房间里的象说: 我们如何防止它成为纯粹的LLM幻觉?
答案是: 工具 代码执行 现实测试
使这个过程实际化的建筑如下:
Your Server(s):
┌─────────────────────────────────────┐
│ Node 1: Routing Agent │
│ - Lightweight code (Node.js/Python)│
│ - Makes decisions │
│ - Calls LLM APIs when needed │
│ - Executes code to test ideas │
└─────────────────────────────────────┘
┌─────────────────────────────────────┐
│ Node 2: Validation Agent │
│ - Runs tests against real data │
│ - Executes validation code │
│ - Calls LLM for complex checks │
└─────────────────────────────────────┘
┌─────────────────────────────────────┐
│ Node 3: Specialist Agent │
│ - Domain-specific logic │
│ - Code execution for that domain │
│ - Calls specialized LLM prompts │
└─────────────────────────────────────┘
All nodes call → [OpenAI API / Anthropic API / Local LLM API]
(This is where the cost is: API credits, not hardware)
密钥 Insight : 您不需要GPU农场。 代理商是正常服务器上的轻量级代码。 他们通过 API 呼叫LLMs。 昂贵的部分是 LLM 信用, 而不是基础设施 。
当一个代理人生成代码或做出决定时,它可以对它进行下列测试:
class Agent:
def solve_problem(self, problem):
# Agent asks LLM to generate solution code
solution_code = self.llm_generate(
f"Write Python code to solve: {problem}"
)
# HERE'S THE KEY: Execute the code and see if it works
try:
result = self.execute_code(solution_code, test_inputs)
if self.validate_result(result):
# It works! Save this solution
self.cache_solution(problem, solution_code)
return result
else:
# Failed validation, try different approach
return self.solve_problem_alternative(problem)
except Exception as e:
# Code failed to execute
# Ask LLM to fix it based on the actual error
fixed_code = self.llm_fix(solution_code, error=str(e))
return self.execute_code(fixed_code, test_inputs)
这改变了一切 系统不仅仅是产生 可信的答案。
# Agent 1 generates a data processing function
code = llm.generate("Write code to parse CSV and calculate averages")
# Agent 2 tests it against REAL data
test_result = execute_code(code, real_csv_file)
# Did it actually work? Not "does it sound right?" but "does it work?"
if test_result.success and test_result.output_matches_expected:
network.accept_solution(code)
else:
# Actual error: "TypeError: cannot convert string to float"
# Now we have OBJECTIVE feedback, not subjective judgment
network.request_fix(code, test_result.error)
这就是我们如何摆脱“中华室”的问题。这个系统不仅仅是操纵符号,而是执行代码和检查结果是否符合现实。
没有工具,多试剂系统只是LLMs与LLMs交谈。 精细,但最终与现实脱节。
工具 :
代理商写代码, 执行它, 测试它, 修复它, 分享有效的东西, 处理无效的东西。
这是 具有客观健身测试目标的进进体体格测试不仅抽象地优化,而且根据可衡量的现实优化。
但不仅仅是代码执行 系统可以建立 语义学 通过多个传感器对不同任务类型进行测试:
class MultimodalAgent:
def __init__(self):
self.semantic_knowledge = {
'text_tasks': SemanticCache(),
'vision_tasks': SemanticCache(),
'audio_tasks': SemanticCache(),
'code_tasks': SemanticCache()
}
def solve_task(self, task):
task_type = self.classify_task(task)
# Check semantic knowledge for similar past solutions
similar = self.semantic_knowledge[task_type].find_similar(task)
if similar:
return self.adapt_solution(similar, task)
# Generate new solution
solution = self.generate_solution(task)
# Test against reality using appropriate sensor
if task_type == 'vision_tasks':
# Generate image, test with vision API
result = self.vision_api.analyze(solution)
passes = self.validate_vision_output(result, task.requirements)
elif task_type == 'audio_tasks':
# Generate audio, test with speech recognition
transcript = self.speech_to_text(solution)
passes = self.validate_audio_output(transcript, task.requirements)
elif task_type == 'code_tasks':
# Execute code, check actual results
result = self.execute_code(solution)
passes = self.validate_code_output(result, task.test_cases)
elif task_type == 'text_tasks':
# Use NLU to verify semantic meaning
understanding = self.nlu_api.analyze(solution)
passes = self.validate_text_output(understanding, task.intent)
# Learn from results
if passes:
self.semantic_knowledge[task_type].store(task, solution, result)
return solution, passes
关键: 每种模式都提供客观的反馈:
该系统建立 语义学知识收集 每种任务类型----不是抽象的推理,而是在对照实际传感器进行试验时实际有效的有根有据的模式。
随着时间的推移,代理商了解到:
Text tasks:
"For summarization, approach X works 94% of the time"
"For translation, approach Y works 89% of the time"
→ Semantic knowledge about what works for text
Vision tasks:
"For object detection, model A is better"
"For style transfer, model B is better"
→ Semantic knowledge about what works for vision
Code tasks:
"For parsing, regex approach fails 30% of the time"
"For parsing, AST approach works 97% of the time"
→ Semantic knowledge about what works for code
每种模式都有自己的语义知识库,通过实际测试而不是理论推理学习。
多试剂系统处理数千个请求。 它开始注意到模式 :
After 1000 requests:
- 73% are simple queries that one agent handles fine
- 19% need two agents (generation + validation)
- 6% need complex committees
- 2% are truly novel and need the full pipeline
人类设计的系统将保持静态。 但自我优化的系统会问:
"为什么我用复杂的管道 满足简单的要求?"
然后它 重写其路线逻辑.
// Week 1: Hard-coded routing (human designed)
function route(request) {
return complexPipeline(request); // Everything uses full pipeline
}
// Week 4: System optimizes itself based on data
function route(request) {
const complexity = analyze(request);
const historicalData = checkCache(request);
if (historicalData.cacheHit) {
return cachedSolution; // 73% of requests!
}
if (complexity < 3) {
return fastSingleAgent(request); // 19% of requests
}
if (complexity < 7) {
return twoAgentValidation(request); // 6% of requests
}
return fullCommittee(request); // 2% of requests
}
系统发现73%的请求 根本不需要任何LLM—— 它们是可以隐藏的重复模式。
没有人编程过这种优化 系统 从数据中学习.
这就是它变得陌生的地方。
系统处理请求数周。 它开始检测集群 :
Pattern Detected:
- 347 requests related to e-commerce product descriptions
- Using general-purpose agents
- Average quality: 7.2/10
- Average latency: 1.8s
人类设计的系统将继续使用一般代理物,但自我优化系统可以做出如下决定:
"我应该生一个专家"
DAY 1: [General Agent A] [General Agent B] [General Agent C]
DAY 30: Pattern detected → System spawns specialist
[General Agent A] [General Agent B] [General Agent C]
[E-commerce Specialist] ← New agent, trained on e-commerce patterns
DAY 60: Specialist proves effective
Routing logic updated automatically
E-commerce requests → E-commerce Specialist (quality: 9.1/10, latency: 0.9s)
网络网络 进进进它根据需求发展了一种新的能力。
没人编程过这个系统 承认一个模式并调整其架构.
现在,它变得非常有趣。
代理 A 发现一个有效的验证电子邮件地址的方法。 它不保留这种知识,而是与网络共享代码 。
# Agent A writes code for email validation
def validate_email_efficient(email):
# Some clever regex or logic
return is_valid
# Agent A publishes to shared code repository
network.publish_code("validate_email_efficient", validate_email_efficient)
# Agent B discovers this code
available_functions = network.browse_code_library()
# Agent B sees "validate_email_efficient" with high rating
# Agent B imports and uses it
# Agent C forks it and improves it
def validate_email_v2(email):
# Agent C's enhancement
return improved_validation
network.publish_code("validate_email_v2", validate_email_v2)
这是 代码进化代理人写字功能,其他代理人发现它们,叉叉,改进它们。
就像GitHub, 但开发商是AI代理, 他们正在建设自己的基础设施。
该网络成为自己的软件工程部门。
最实际的自我优化:建立解决方案的记忆。
Request 1: "Generate a product description for wireless headphones"
→ Full LLM pipeline (expensive, slow)
→ Store solution in vector database
Request 847: "Generate a product description for wireless earbuds"
→ Vector search finds similar past solution
→ Adapt cached solution (cheap, fast)
→ No LLM needed!
After 10,000 requests:
- 89% cache hit rate
- 11% genuinely novel requests that need LLMs
- System effectively "learned" from experience
这是情报吗 还是很精密的暗藏
有什么区别?
这是最奇怪的部分
你从复杂的多试剂结构开始 12个专业代理 复杂的路线逻辑 临时委员会的组建 代码共享基础设施
系统运行数月 自我优化
它发现了一些深刻的东西:
简单化通常更好。
Month 1:
- 12 specialists
- Complex routing logic
- Committee formation for 15% of requests
- Average cost: $0.05/request
Month 6:
- 5 specialists (system pruned 7 as unnecessary)
- Simple routing: cache check → fast model → quality model if needed
- Committees formed for only 3% of requests
- Average cost: $0.003/request
- Quality: SAME OR BETTER
The system's report:
"After analyzing 50,000 requests, I've determined that:
- 89% can be handled by cache
- 7% need one LLM call
- 3% need committees
- 1% are truly novel
I've optimized away unnecessary complexity.
The most sophisticated self-organizing network
eventually learns to be simple."
矛盾:你需要复杂的自我优化系统 来发现简单是最佳的。
你需要智慧来学习 当不聪明的时候。
坦白地说,我们所描述的是:
认认 该系统发现反复出现的问题。 适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应适应 系统根据模式改变其行为 学习学习学习学习 该系统通过经验提高业绩 演变演变进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进进 该系统产生、改变和淡化能力 内存 该系统逐步积累知识
"非常精密的优化"什么时候会变成"实际学习"?
"学习"什么时候成为"情报"?
class SelfOptimizingRouter:
def __init__(self):
self.routes = {} # Start empty
self.performance_data = []
self.specialists = [DefaultAgent()]
def handle_request(self, request):
# Try cache first
cached = self.check_cache(request)
if cached:
return cached
# Select agent based on learned patterns
agent = self.select_agent(request)
result = agent.process(request)
# Learn from this interaction
self.record_performance(request, agent, result)
# Periodically optimize
if len(self.performance_data) % 1000 == 0:
self.optimize()
return result
def optimize(self):
"""System rewrites its own logic"""
# Detect patterns
patterns = self.analyze_patterns(self.performance_data)
# Should we spawn a specialist?
for pattern in patterns:
if pattern.frequency > 100 and pattern.has_specialist == False:
print(f"Spawning specialist for {pattern.type}")
self.spawn_specialist(pattern)
# Should we prune an underutilized agent?
for agent in self.specialists:
if agent.usage < 1% and agent.quality_score < 7.0:
print(f"Pruning ineffective agent {agent.name}")
self.specialists.remove(agent)
# Rewrite routing logic based on data
self.routes = self.learn_optimal_routes(self.performance_data)
这个代码很简单,但经过数周的运行,它:
没人教它如何优化 只是它应该优化
如果系统能够:
那是"学习"系统吗?
还是只是"优化"?
有什么区别?
优化何时成为认知?
我们从以下几方面有所进展:
但还有一步
当你把这些都结合在一起时,又出现了一个财产。
当简单的规则造成复杂的行为... 交流创造集体智慧... 自我优化可以创造学习...
似乎不像“一个自我优化的系统” 更像是“一个系统 理解."
优化和意识之间的界线开始模糊。
我们必须面对一个令人不舒服的问题:也许没有界线。
也许意识只是非常精密的自我优化
这就是我们接下来要探索的
系列导航:
© 2026 Scott Galloway — Unlicense — All content and source code on this site is free to use, copy, modify, and sell.