<!-- Canonical page: https://reversedwithai.com/p/apple-neural-engine-training -->
Canonical page: https://reversedwithai.com/p/apple-neural-engine-training

# Reverse engineered Apple Neural Engine private APIs with Claude to train networks on the M4 ANE

> Training neural networks on Apple's Neural Engine without CoreML.

With Claude Opus 4.6 as co-developer, the author mapped AppleNeuralEngine.framework's private classes and in-memory compile path, benchmarked the M4 ANE and ran backpropagation on it without CoreML.

## Key facts

- Target: Apple Neural Engine (M4)
- Category: APIs and protocols
- Platform: macOS / Apple Silicon
- Models: Claude Opus 4.6
- Outcome: Works
- License: MIT
- Checks: Source available: yes; Repro steps: yes; Real hardware: yes; Verified by others: not reported
- Author: [Manjeet Singh (maderix)](https://maderix.substack.com)
- Added: 2026-10-14
- Updated: 2026-10-14
- Sources reviewed: 2026-10-14 (editor)

## What was done

Manjeet Singh (maderix), working with Claude Opus 4.6 as a pair, reverse engineered the private APIs behind Apple's Neural Engine on the M4 and trained transformer models on it without CoreML. Training works, but the README says utilisation is low, about 5 to 9% of peak, and many element-wise operations still run on the CPU.

### How it was done

The write-up says "we" means maderix and Claude Opus 4.6, with the human driving exploration and the AI reasoning through data and writing code. They dumped every Objective-C class in AppleNeuralEngine.framework with `dyld_info -objc`, swizzled methods to intercept CoreML's calls, analysed compiled E5 bundles, and ran scaling experiments to infer hardware layout. They found more than 40 private classes, including `_ANEClient`, `_ANEModel`, `_ANERequest` and `_ANEInMemoryModelDescriptor`. The last accepts MIL program text in memory, which avoids the disk round trip on every weight update, though it still needs a writable temp directory internally.

### Results

The project runs forward and backward passes on the ANE, with weight gradients and the Adam optimizer on the CPU. The README reports 91 ms per step for Stories110M (109M parameters) and 412 ms per step for Qwen3-0.6B (596M parameters) on an M4. Listed limitations include the ANE ignoring attention masks, a compiler resource leak after about 119 compiles (worked around by restarting from a checkpoint), fp16 gradient underflow fixed with loss scaling, and a single-input constraint. The author says it does not replace GPU training beyond small research models, and calls it research code rather than a maintained framework.

## Human work and limitations

The README says training works but utilisation is low (about 5 to 9% of peak) and many element-wise ops fall back to CPU. Several hardware limits, such as a compile resource leak and ignored attention masks, needed workarounds.

## What the commit history shows

4 of 42 commits in the public repository credit an AI, over 2 days between 2026-03-01 and 2026-03-03. Credited: Claude Opus 4.6 (3), Claude (version not given) (1).

Measured by this site from public git history.

## Sources

- [Repository](https://github.com/maderix/ANE)
- [Write-up](https://maderix.substack.com/p/inside-the-m4-apple-neural-engine)

Figures are reported by the author and not measured by this site, except the commit history. Entry drafted with AI from the linked sources and checked against them.

Cite as: Manjeet Singh (maderix) (2026). Reverse engineered Apple Neural Engine private APIs with Claude to train networks on the M4 ANE. Reversed with AI. https://reversedwithai.com/p/apple-neural-engine-training
