跳到正文
r/MachineLearning· /u/WAMFT·· 21 天前AI 评分35

两个 AI 架构实验:PHSMLP 共享 MLP 与 Pilot 非线性矩阵记忆

Two AI architecture experiments I've been working on — PHSMLP and Pilot [R]

AI 导读

研究者公开两项小型架构实验:PHSMLP 让 Transformer 各层复用同一个 MLP 并加入可学习 head pooling,在 5 亿 FineWeb-Edu token 上训练后测试准确率仅落后标准 Transformer 不到 3 个百分点,且参数少 13.4%。

正文
Two AI architecture experiments I've been working on — PHSMLP and Pilot [R]

Recently i have been experimenting with a couple of neural network ideas and thought I'd share the results. Both are relatively small research experiments, but I found some of the results quite interesting.

1. PHSMLP — Pooled Head MLP

GitHub: https://github.com/rickey1990/PHSMLP---Pooled-Head-MLP

The idea behind PHSMLP was to see whether a Transformer could reuse a single MLP across its layers, rather than having a separate MLP for each layer, and whether learned head pooling could help compensate for the reduction in parameters.

I trained four models on 500 million FineWeb-Edu tokens each.

Results:

ModelTest perplexityTest accuracyStandard Transformer88.7523.95%Standard + pooling90.6023.50%Shared MLP105.9821.18%Shared MLP + pooling105.6621.03%

The shared MLP was less than 3 percentage points behind the standard Transformer in test accuracy. The shared pooled model also used 13.4% fewer parameters.

Interestingly, pooling did show some positive effects within the shared architecture. It slightly improved perplexity compared with the plain shared MLP, while also improving fact-overwriting and multi-hop probe scores.

When I disabled pooling in the trained shared model, perplexity increased from 100.02 to 181.20 on the ablation test subset. This shows that the model had learned to make meaningful use of its pooling mechanism.

Although the improvements over the independently trained shared MLP were small and not conclusive, I think it's encouraging that a single shared MLP could retain much of the original Transformer's performance, and that pooling provided a useful learned pathway.

The standard Transformer still performed best overall, but I think the combination of weight sharing and learned head pooling deserves further investigation.

2. Pilot — Nonlinear Matrix Memory

GitHub: https://github.com/rickey1990/Pilot-AI

Pilot builds on my earlier ILRM research. The main idea was to investigate whether FFT could be used to calculate an explicit input history without constructing a temporal Toeplitz matrix, while keeping a separate nonlinear recurrent memory.

The architecture combines:

An exponential history of previous input matrices.

A nonlinear matrix memory controlled by access and write gates.

Key, value and query projections for constructing inputs and reading the memory.

The history can be calculated using FFT, sequential scan or parallel prefix scan. All three calculate the same mathematical history, and the numerical checks showed agreement within floating-point tolerances.

The important distinction is that FFT operates on the history pathway, not the nonlinear recurrent matrix itself. The memory doesn't need to be Toeplitz, diagonal or linear.

I trained Pilot FFT against a parameter-matched four-head Transformer using two T4 GPUs and 63.57 million FineWeb-Edu tokens per model.

Results:

ModelParametersTest perplexityTest accuracyTransformer428,608126.2417.61%Pilot428,523105.1520.35%

Pilot achieved 16.7% lower test perplexity than the Transformer, which was a pleasant surprise.

However, it didn't win across the board. The Transformer performed better overall on the small memory-probe suite, scoring 17/96 compared with Pilot's 11/96. Neither model reliably solved the recall, fact-binding or multi-hop reasoning tasks, and both scored zero on unrestricted next-token answers to those probes.

Pilot also showed little benefit from distant context and was around 60 times slower to train in the current implementation.

So while the language-modelling results were encouraging, long-term memory and training efficiency are still problems to solve.

Why the name Pilot?

There seem to be quite a few fierce animal names in AI, and I wanted something with a bit of a British connection. We aren't exactly spoiled for choice when it comes to fierce animals in the UK, so I thought of the pilot whale. It's also the pilot experiment for this idea, so the name seemed fitting!

Final thoughts

I'm not claiming either architecture is better than the Transformer overall. These are single-seed, small-scale experiments that need more testing.

PHSMLP demonstrated that sharing an MLP can retain much of a Transformer's predictive performance with fewer parameters, while learned pooling showed some encouraging benefits within the shared architecture.

Pilot demonstrated that FFT-compatible input history can work alongside nonlinear recurrent matrix memory, with a promising improvement in language modelling at matched parameter counts.

I consider both largely positive exploratory experiments, including the things that didn't work. I'm particularly interested in understanding how to improve Pilot's memory and speed without adding lots of extra machinery or changing its original mathematics.

The research PDFs, code, diagrams and results are available in the GitHub repositories above.

I'd really appreciate any feedback or thoughts on either architecture.

submitted by /u/WAMFT
[link] [留言]

来源:r/MachineLearning · reddit.com