什么是集体智能?
集体智能是指多个模型、信号与决策过程作为统一系统协同工作时,所涌现出的智能。
核心思想
正如专家团队能比任何单一专家更好地解决问题,一组专用 LLM 也能比单一模型提供更优结果。
传统做法:单模型
用户查询 → 单一 LLM → 响应
局限:
- 一个模型试图面面俱到
- 缺少专精与优化
- 简单与复杂任务用同一模型
- 难以从模式中持续学习
集体智能:模型系统
用户查询 → 信号提取 → 投影协调 → 决策引擎 → 插件 + 模型分发 → 响应
↓ ↓ ↓ ↓
14 类信号族 分区 / 打分 / 映射 布尔策略 专用模型
优势:
- 各模型专注所长
- 系统从全量交互中学习模式
- 基于多信号的自适应路由
- 信号融合带来涌现能力
集体智能如何产生
1. 信号多样性
不同信号刻画智能的不同侧面:
| 信号族分组 | 智能侧面 |
|---|---|
启发式(authz、context、keyword、language、structure) | 快速的请求形态、区域与策略门禁 |
学习型(complexity、domain、embedding、modality、fact-check、jailbreak、pii、preference、user-feedback) | 语义、安全、模态与偏好理解 |
集体收益:多信号组合比单一信号理解更丰富。
2. 投影协调
当路由器把信号协调成可复用的中间事实时,价值更大:
projections:
partitions:
- name: balance_domain_partition
semantics: exclusive
members: [mathematics, coding, creative]
default: creative
scores:
- name: reasoning_pressure
method: weighted_sum
inputs:
- type: complexity
name: hard
weight: 0.6
- type: embedding
name: math_intent
weight: 0.4
mappings:
- name: reasoning_band
source: reasoning_pressure
method: threshold_bands
outputs:
- name: balance_reasoning
gte: 0.5
集体收益:投影将多条较弱或竞争性的信号转化为可复用的命名路由事实,供多条决策共用。
3. 决策融合
信号通过逻辑运算符组合:
# 示例:多信号数学路由
decisions:
- name: advanced_math
rules:
operator: "AND"
conditions:
- type: "domain"
name: "mathematics"
- type: "projection"
name: "balance_reasoning"
集体收益:多信号「共同投票」比单一信号更准确。
4. 模型专精
不同模型贡献各自强项:
modelRefs:
- model: qwen-math # 数学推理
weight: 1.0
- model: deepseek-coder # 代码生成
weight: 1.0
- model: claude-creative # 创意写作
weight: 1.0
集体收益:系统级智能来自把查询交给合适的专家。
5. 插件协作
插件协同增强响应:
routing:
decisions:
- name: "protected-route"
plugins:
- type: "semantic-cache" # 加速
- type: "response_jailbreak" # 响应筛查
- type: "system_prompt" # 上下文
- type: "hallucination" # 质量
集体收益:多层处理使系统更稳健、更安全。
实例
用户查询
"Prove that the square root of 2 is irrational"
信号提取
signals_detected:
keyword: ["prove", "square root", "irrational"] # 数学关键词
embedding: 0.89 # 与数学查询高相似
domain: "mathematics" # MMLU 分类
fact_check: true # 证明需要核验
投影协调
projection_outputs:
balance_domain_partition: "mathematics"
balance_reasoning: true
决策
decision_made: "advanced_math"
reason: "数学领域且投影指示推理压力"
confidence: 0.95
模型 选择
selected_model: "qwen-math"
reason: "擅长数学证明"
插件链
plugins_applied:
- semantic-cache: "未命中缓存,继续"
- response_jailbreak: "持续检查输出是否越界"
- system_prompt: "追加:请给出严格数学证明"
- hallucination: "启用事实核验"