Files
ts-as-modality/openspec/changes/ts-as-modality/proposal.md
T
张宗平 150e3bd9fd docs(ts-as-modality): archive after cross-domain generalization failure
Full diagnostic chain (synth→real zero-shot→real finetune→held-out) shows
the TS-modality approach works in-distribution but fails to generalize
across entities: same SMD dataset, same 38 channels, just a different
machine (1→2) collapses output to repetition garbage. Root cause is the
lightweight TS encoder (2-layer TF, 2.1M params) learning dataset/machine-
specific patterns rather than transferable time-series representations.

This is a valuable negative result: it cleanly rules out the
'0.5B LLM + 2-layer TS encoder + single-distribution synth training'
route for general time-series understanding, which is more credible than
any 'looks like it works but never tested cross-domain' result.

Records:
- tasks.md: M6 diagnostic section (6.1-6.5) with evidence + archive decision
- proposal.md: Status header flagging archive + pointer to diagnosis
- docs/diagnosis-2026-07-02-cross-domain.md: full evidence chain, root-cause
  analysis, capability boundaries, asset inventory, restart conditions

Project status: archived. Code/data/checkpoints/reports preserved.
Restart requires any of: (1) larger encoder + real-data from-scratch
training, (2) channel-agnostic patch strategy, (3) multi-dataset joint
training with held-out-dataset generalization proof.
2026-07-03 11:52:09 +00:00

4.2 KiB
Raw Blame History

Status

已封存(2026-07-02。完整诊断与结论见 docs/diagnosis-2026-07-02-cross-domain.md。摘要:合成域内有效(QA 2.41 vs pure_llm 0.89TS token 消费率 0.98),但真实时序跨实体泛化失败——同 SMD 数据集换机器即崩溃为 garbage 输出。TS encoder2层TF/2.1M参数)学到数据集特有模式而非通用时序表征。方案作为研究性 PoC 划定了能力边界(合成域可行/跨域不可行),资产保留,重启条件见诊断报告。

Why

当前 AIOps 场景下,多变量时序的异常检测与解释仍依赖专用模型,缺乏「以自然语言对时序提问、做根因/事件关联推理」的统一能力。基于 MTSAD-技术深度调研报告.md,沿用 ChatTS「时序作为新模态」路线,我们希望在单张 3060 12GB 消费级显卡上做一个可复现的实验性落地,验证「把多变量时序视为独立模态、与文本/事件模态联合注入小型 LLM」这一方法在算力受限条件下是否切实可行、且「时序模态」是否真带来可量化的增益。现在做是因为:0.5B 级开源 LLM 与 PEFT/LoRA 工具链已足够成熟,使该实验在消费级硬件上首次成为可能。

What Changes

  • 新增:CPU 离线合成数据管线(成分模型 + 异常注入 + 事件耦合 + Evol-Instruct 指令/回答生成),产出对齐预训练与 SFT 用的 JSONL
  • 新增:真实 benchmarkSMD/MSL/SMAP/SWaT/PSM)窗口加载与「异常段→问答对」改写(仅评测用,不进训练)
  • 新增TS EncoderPatchify + 2 层 Transformer+ ProjectorLinear→LLM hidden),把时序编码为独立 soft token
  • 新增:多模态拼接器,按 [属性][时间戳][TS token][事件][问题] 顺序组装文本 token 与 TS token 注入 LLM
  • 新增:两阶段训练流程 —— 阶段①冻结 LLM 训 Encoder+Projector(对齐预训练);阶段②叠加 LoRA(r=16) 做指令微调
  • 新增:评测套件 —— 文本回答→JSON 区间→逐点分数解析;VUS-PR(主)/Affiliation-F1/AUC-PR/Point-F1(无PA)LLM-judge + 规则解析双轨
  • 新增:4 类同口径对照基线(纯 LLM 数值喂文本 / Time-LLM 风格重映射 / ChatTS(若可复现) / Trivial
  • 骨干选用 Qwen2.5-0.5B-InstructBF16 + LoRA + 梯度检查点,目标阶段②峰值显存 ≤11GB

Capabilities

New Capabilities

  • ts-synthesis: CPU 离线合成数据管线——成分模型(趋势/周期/基线/噪声)、异常注入(尖刺/水平偏移/方差膨胀/缺失段/缓慢漂移)、事件耦合、缺失/不规则模拟、属性词表采样,以及 Evol-Instruct 多轮指令与回答生成;附带真实 benchmark 加载与问答改写
  • ts-multimodal-model: 时序作为模态的多模态模型——TS Encoder + Projector + 多模态拼接(TS token 与文本/事件 token 联合注入 LLM),含阶段①对齐预训练与阶段②LoRA SFT 的训练/推理统一封装
  • ts-evaluation: 时序问答与异常检测评测套件——回答解析(文本→JSON 区间→逐点分数)、阈值无关指标(VUS-PR 主/Affiliation-F1/AUC-PR/Point-F1 无 PA)、LLM-judge + 规则双轨、4 类同口径基线对照、可复现评测报告

Modified Capabilities

Impact

  • 新增代码:独立 Python 项目 ts-as-modality/pyproject.toml + src/tsmm/{data,model,train,eval,utils} + scripts/ + tests/ + configs/),与当前 spec/docs 工作区并列
  • 依赖torch、transformers、peft、accelerate、datasets、numpy、tqdm、pyyaml、pytest;评测依赖 tsb_uadVUS-PR);LLM-judge 评测时调用 OpenAI/GPT-4o API
  • 模型资产Qwen2.5-0.5B-Instruct 骨干(外部下载);阶段①/② checkpoint 与合成数据产物体积较大,需 git-ignore(data/checkpoints/
  • 算力:单张 3060 12GB;阶段①预估峰值 ~4-5GB,阶段②预估峰值 ~9-10GB;CPU 多进程用于离线合成
  • 存储:合成数据约 2-3GB(流式加载),checkpoint 分阶段独立存放
  • 无 BREAKING 变更:纯新增独立实验项目,不触碰现有任何代码/接口