guilingzhouyi-creator/NOMOS

GitHub: guilingzhouyi-creator/NOMOS

NOMOS 是一个多维度 AI 代码治理与基准测试系统,通过编译、多文件拆分、模糊提示、上下文污染等五个维度全面评估 AI 代码生成能力并支持 QLoRA 闭环微调。

Stars: 1 | Forks: 0

# NOMOS — 首个 AI 代码治理与基准测试系统

5 dimensions Python + C# 4 models 15K+ RC events MIT QLoRA in progress

## NOMOS 是什么 **NOMOS 不是一个基准测试。它是一个维度工厂。** 现有的每个基准测试只测试一件事(HumanEval:算法正确性,SWE-bench:Bug 修复)。NOMOS 测试了所有它们未涵盖的内容: | 它们遗漏了什么 | NOMOS 如何捕获它 | |:---|:---| | 它能编译吗? | `dotnet build` / `py_compile` — 确定性的通过/失败 | | 它能拆分成规范的文件吗? | 具有 `f=N/M` 评分的多文件 L2-L4 基准测试 | | 它能处理模糊的 prompt 吗? | 模糊基准测试:“制作一个用户系统” → 对文件数量进行评分 | | 它能在上下文污染下存活吗? | 注入真实的 VS Code Agent 上下文(7 层 + 200 轮) | | 它在 C# 和 Python 下都能工作吗? | 双语矩阵 — 跨语言排名反转 | | 微调能修复它吗? | 带有训练前后对比的 QLoRA 训练 pipeline | ## 矩阵(5 个维度,3 个模型,2 种语言) | 模型 | Python80 | C#30 | C# Multi-8 | Fuzzy20 | **Pollution10** | |:---|:--:|:--:|:--:|:--:|:--:| | **coder:6.7b** | 72% | 70% | 62% | 100%* | **80%** | | **qwen:7b** | 80% | 87% | **88%** | 95%* | **30%** | | **v4-flash** (云端) | **81%** | **100%** | **88%** | 100%* | 100% | **[完整排行榜 →](v0.1/LEADERBOARD.md)** ## 关键发现 1. **纯净的基准测试具有欺骗性**。qwen:100% 纯净 → 30% 污染。你会部署它。然后它就会崩溃。 2. **模型规模并不重要**。6.7B coder 在抗污染能力上击败了云端的 v4-flash。 3. **污染的质量 > 数量**。100K 同领域噪声 = 毫无影响。15K 跨领域指令 = 0-30% 的破坏力。 4. **多文件才是真正的断崖**。L2 两文件:全部通过。L3 三文件+接口:coder 跌至 0%。 5. **即使是 1.3T 参数也会失败**。在 392K 上下文下,v4-pro 在 4 项任务中需要 13 次人工纠正。 ## 架构:7 层 ``` L0 Multi-language scan — tree-sitter AST, Python + C# L1 Rule engine — 47 rules, 15,010 RC events L2 Deterministic GATE — Format, hallucination, self-consistency L3 LLM semantic — Reasoning-aware dual-track (LLM + keyword) L4 Statistical — Pareto/Jaccard/Z-score pattern discovery L5 Evolutionary — Rule fitness competition, shadow evaluation L6 Constitutional — Meta-rules governing L0-L5 ``` 评判模型的系统本身也受到治理。每一层都为下一层提供输入。每一次发现都会使规则更加锐利。 ## 快速开始 ``` git clone https://github.com/guilingzhouyi-creator/NOMOS.git cd NOMOS/v0.1 # 运行完整的 Python benchmark(80 个问题) python _long_prompt_bench.py # 运行 C# benchmark(30 个问题) python _cs_bench.py # 运行多文件 C# benchmark python _cs_multifile_bench.py # 运行模糊提示 benchmark python _real_bench.py # 运行 pollution benchmark python _pollution_bench.py # 提取你自己的 VS Code context 作为 pollution source python _context_extractor.py # 运行 QLoRA 微调(Google Colab) # 查看 colab_qlora.py ``` ## 仓库结构 ``` v0.1/ — Core engine & benchmarks ├── _long_prompt_bench.py — Python 80-problem benchmark ├── _cs_bench.py — C# 30-problem benchmark ├── _cs_multifile_bench.py — C# multi-file L2-L4 benchmark ├── _real_bench.py — Fuzzy prompt + multi-file benchmark ├── _pollution_bench.py — Context pollution benchmark ├── _gradient_pollution.py — Multi-gradient (10K/50K/100K) test ├── _context_extractor.py — VS Code real context extraction ├── _qlora_train.py — QLoRA training script ├── colab_qlora.py — Google Colab one-click training ├── LEADERBOARD.md — Full multi-dimensional matrix ├── .reference_channel/ — RC: 15,010+ verified events ├── output/ — Generated code & test results └── train_data/ — QLoRA training pairs ``` ## NOMOS 回答的研究问题 - 在 Agent 式的上下文污染下,模型性能如何下降? - 当使用合规数据进行微调时,7B 本地模型能否击败云端模型? - 多文件解耦的断崖在哪里 —— 哪些模型能挺过去? - prompt 的清晰度能否预测代码质量? - “AI 代码治理”能否作为闭环的微调反馈来运作? ## 引用 ``` @software{NOMOS2026, author = {guilingzhouyi}, title = {NOMOS: A Multi-Dimensional AI Code Governance \& Benchmark System}, year = {2026}, url = {https://github.com/guilingzhouyi-creator/NOMOS} } ``` ## 许可证 MIT — 随意使用,分叉,并在其基础上进行构建。 *由一名大学生 + 一个 LLM agent 共同构建。首先发现了问题,然后构建了解决方案。*
标签:AI代码治理, DLL 劫持, 人工智能, 代码评估, 大语言模型, 模型微调, 用户模式Hook绕过, 逆向工具