惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

小众软件
小众软件
博客园 - Franky
罗磊的独立博客
G
Google Developers Blog
The GitHub Blog
The GitHub Blog
P
Proofpoint News Feed
Recent Announcements
Recent Announcements
V
V2EX
F
Fortinet All Blogs
阮一峰的网络日志
阮一峰的网络日志
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
U
Unit 42
GbyAI
GbyAI
A
About on SuperTechFans
WordPress大学
WordPress大学
Engineering at Meta
Engineering at Meta
雷峰网
雷峰网
Microsoft Azure Blog
Microsoft Azure Blog
Martin Fowler
Martin Fowler
D
DataBreaches.Net
The Cloudflare Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
MongoDB | Blog
MongoDB | Blog

V2EX

我用 AI 写代码,但终端管理反而成了累赘——于是我做了 codux [调研] 各位在公司都用什么 ide 和 agent 写代码? 老运维 share 一个运维平台 看到有公司考核 token 指标,很好奇大家上个月的 AI 账单是多少 GLM-Coding 调用持续报错: z.ai 的 Lite 套餐几乎无法使用,官方 Pro/Max 是否稳定? 现在还有什么渠道可以稳定安全地使用 Claude 吗? 上海漕河泾内推,本组有 2 个 hc,一个后端,一个前端,预算都是 20k 左右,不打卡,氛围好 如果 V2EX 上有一组不永久保存聊天记录(比如只保存 7 天或者 24 小时)的聊天室,那么会开启哪些有用或者有趣的可能? gemini cli 貌似挂了,一直返回 403 第一次在自媒体上赚到钱 收集了最近在使用的低价 GPT, Gemini,邮箱等 AI 会员的小店合集 讨论个大实话:现在企业还在说 AI 编程提效 20%, 30%的,真的太落后,没用懂 AI。因为包括很多前沿公司,已经狂奔到提效 200%-500%的情况 [招聘][远程][币安] 前端/后端/QA/iOS/Android 至少 3 年以上经验 目前有大量 HC 欢迎投递 Chatgpt Pro 用量用不完的可以开这些设置 面试的时候好像遇到钓鱼了,给各位避个坑 cursor 年续费 22 号到期, 自动续费是否还是老的计次套餐呢 被两件破事毁掉的一下午,琐碎的内耗消磨人的精力 使用 Planet 存储 Codex 的会话或者重要信息 如果业务部门领导不要你开发功能,而是要求你教会它用 claude code 开发功能,你会怎么做? 分享一个 MacOS 接绿联 CM818 USB 转 DP 转接器使用感受 我的 HR 朋友 10 年老 Java ,非全大专,大家帮忙看看简历 开源了一个 AI 口语练习工具,音素级发音评分,完全免费可自部署 V2EX 上有哪些你觉得很有趣、印象深刻的妹纸? 字节为啥不出个国内版 Vercel? 有在大马的朋友吗? 问个运营商问题 你们在有领导的公司大群发过的最大胆的消息是什么 公司裁员,目前没有工作。想试试摆摊,做一个移动鲜啤打酒车 我的硬盘 Memblaze Pblaze 5 Linux 下不识别,给 Linux 内核提交了补丁, AI 说有望被合并 只有我一个人觉得 codex 不好用?
宣传一下我的开源神经网络训练架构,请大家多多批评。
evegod · 2025-12-18 · via V2EX

🌌 H2Q-MicroStream: Holographic Hamiltonian Quaternion Transformer

"智能不是记忆过去的所有细节,而是掌握生成未来的核心方程。"

"Intelligence is not about memorizing every detail of the past, but mastering the core equations that generate the future."

License: MIT PyTorch Status


📖 项目简介 / Introduction

H2Q-MicroStream 是一个极具实验性的深度学习架构,旨在探索语言模型的物理动力学本质。与追求巨大参数量和超长上下文窗口的主流 Transformer 不同,本项目基于奥卡姆剃刀原则 (Occam's Razor) 和 **全息原理 (Holographic Principle)**,构建了一个极简、实时、且具有强物理约束的“思维内核”。

H2Q-MicroStream is a highly experimental deep learning architecture designed to explore the physical dynamics of language models. Unlike mainstream Transformers that chase massive parameter counts and infinite context windows, this project builds a minimalist, real-time, and physically constrained "Thinking Kernel" based on Occam's Razor and the Holographic Principle.

核心哲学 / Core Philosophy

  1. 思考内化 vs. 语言表达 (Internalization vs. Expression):

    • 我们认为,现有的 LLM 花费了太多算力去学习“如何像人一样说话”(语法糖),而忽略了“如何构建世界模型”(核心逻辑)。
    • H2Q 旨在构建一个高维全向的思维核心。它的中间状态可能人类难以直接理解(类似于脑电波),但它包含了对信息本质的拓扑映射。
    • We believe current LLMs spend too much compute on "speaking like a human" (syntax) rather than "modeling the world" (core logic). H2Q aims to build a high-dimensional, omnidirectional thinking kernel.
  2. 状态保持 vs. 历史回溯 (State-based vs. Retrieval-based):

    • 人类没有 128k 的上下文窗口。我们靠的是核心状态 (State) 的实时演化。
    • 本架构放弃了对历史数据的无限 Attention ,转而追求在极短视界( Micro-Horizon )内的哈密顿动力学演化
    • Humans don't utilize 128k context windows; we rely on the real-time evolution of a Core State. This architecture abandons infinite attention on history in favor of Hamiltonian dynamic evolution within a Micro-Horizon.
  3. 本质压缩 (Essence Compression):

    • 如果一个规律不能用极少的基底( Rank 8 )解释,那就是在死记硬背。
    • If a pattern cannot be explained with a minimal basis (Rank 8), it is rote memorization, not learning.

🚀 关键技术特性 / Key Technical Features

1. 🌌 四元数时空注意力 (Quaternion Spacetime Attention)

引入四元数 (Quaternion) 代数,将注意力机制从标量积升级为四维时空干涉

  • 实部 (Real Part): 代表能量/幅度,决定注意力的强度。
  • 虚部 (Imaginary Part): 代表自旋/相位,引入非线性的**相位旋转反馈 (Phase Rotation)**。
  • 这使得模型能够捕捉语言中的“纠缠”和“反讽”等高维特征。

Moves attention from scalar products to 4D spacetime interference. Real parts represent energy/amplitude; Imaginary parts represent spin/phase, introducing nonlinear Phase Rotation Feedback to capture high-dimensional linguistic entanglement.

2. 📉 Rank-8 本质约束 (Rank-8 Essential Constraint)

模型权重不是静态矩阵,而是通过 Structure Bank 动态生成的。我们强制将 Rank 限制为 8

  • 这逼迫模型放弃“背书”,只能提取最核心的 8 种时空演化规律。
  • 这也极大地降低了计算消耗,实现了参数的“全息折叠”。

Weights are dynamically generated via a Structure Bank with a forced Rank of 8. This forces the model to abandon rote memorization and extract only the 8 most essential spacetime evolution patterns.

3. 🌊 Unicode 流式动力学 (Unicode Stream Dynamics)

摒弃了 BPE Tokenizer (如 Tiktoken ),直接使用 Unicode (ASCII/UTF-8) 编码。

  • 拒绝“方言”:建立通用的底层物理接口,让模型直接处理字节流。
  • 并行流训练:模拟多路并行的连续阅读体验,而非随机切片。

Abandons BPE Tokenizers for direct Unicode (ASCII/UTF-8) encoding. establishing a universal physical interface. Uses parallel streaming to simulate continuous reading flow rather than random slicing.

4. ⚡️ 微批次高频更新 (Micro-Batch High-Freq Update)

  • Batch Size = 24: 模拟极低容量的短期记忆。
  • No Gradient Accumulation: 每看一眼数据就更新一次参数。
  • 这模拟了生物神经元的高频脉冲学习,使参数在流形空间中进行连续的微分演化。

Simulates biological high-frequency impulse learning. With a micro-batch of 24 and continuous updates, the parameters undergo continuous differential evolution in the manifold space.


🛠️ 安装与运行 / Installation & Usage

环境要求 / Requirements

  • Python 3.8+
  • PyTorch 2.0+ (CUDA support recommended for TF32 acceleration)
  • NVIDIA GPU (Optimized for Ampere/Ada architectures like RTX 3090/4090/4070Ti)

快速开始 / Quick Start

  1. 克隆仓库 / Clone the repository

    git clone https://github.com/makai891124-prog/H2Q-Transformer.git
    cd H2Q-Transformer
    
  2. 安装依赖 / Install dependencies

    pip install torch numpy requests
    
  3. 运行训练 / Run training 无需手动下载数据,脚本会自动下载 WikiText-2 数据集并开始训练。 No need to manually download data; the script will automatically download WikiText-2 and start training.

    python main.py
    

📊 配置说明 / Configuration

main.py 中的 CONFIG 字典中调整参数。当前默认配置为 "H2Q-MicroStream" 模式:

CONFIG = {
    'dim': 768,            # 模型宽度 (GPT-2 Small level)
    'fixed_rank': 8,       # 🌟 核心参数:限制模型的"脑容量"以逼迫其思考
    'seq_len': 128,        # 微视界:只关注当下瞬间
    'batch_size': 24,      # 物理 Batch:极小,高频更新
    'depth': 12,           # 深度
    'axiom_lambda': 0.1,   # 正交性约束强度
    # ...
}

🔮 展望与未来 / Future Roadmap

目前的 H2Q 模型是一个纯粹的思维内核。它的输出可能看起来像“乱码”或极其抽象的方言,这是因为它正在展示内部的原始状态流

未来的开发计划包括:

  1. 解码器挂载 (Projector): 训练一个独立的“翻译器”模块,将 H2Q 的全息状态映射回人类自然语言。
  2. 多模态流 (Multimodal Stream): 由于采用 Unicode/Byte 接口,尝试直接输入音频或图像字节流。
  3. 边缘侧部署 (Edge Deployment): 利用 Rank-8 的极高压缩率,尝试在移动端运行全息内核。

The current H2Q model is a pure thinking kernel. Future plans include training a separate "Projector" to translate holographic states into human language, exploring multimodal byte streams, and edge deployment via high compression rates.


📜 许可证 / License

本项目采用 MIT License 开源。


致谢 / Acknowledgements

感谢所有探索几何深度学习、SSM (State Space Models) 以及对 Transformer 架构进行反思的研究者们。本项目的灵感来源于全息原理、哈密顿力学以及人类认知的本质。