frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Chunked KL loss, running Knowledge Distillation locally in less <6GB VRAM

https://github.com/CompactifAI/Full-Chunked-KL-Loss
2•ikergarcia1996•1h ago

Comments

ikergarcia1996•1h ago
Hello everyone!

I’ve been working on an efficient implementation of the KL-divergence loss that reduces its VRAM usage from quadratic to linear, using an approach very similar to Flash Attention: chunking and fusing the forward and backward passes. The loss is mathematically equivalent to the standard KL-divergence loss available in PyTorch.

Until now, Knowledge Distillation required a huge amount of VRAM and was practically impossible to run locally at meaningful context lengths. With this implementation, the KL loss goes from requiring ~85 GB of VRAM at a 32K context length to ~5 GB. The loss is also ~3× faster at long context lengths.

This unlocks the possibility of performing Knowledge Distillation locally, allowing you to train small student models from large teacher models without needing access to an H200 node.

The code is open-source: https://github.com/CompactifAI/Full-Chunked-KL-Loss/

One caveat is that, because the implementation requires patching the model’s forward pass to chunk the LM-head computation, it cannot be used as a direct drop-in replacement for PyTorch’s KL loss. However, this patch can easily be implemented with Claude Code, Kimi K3, GLM, etc. in just a few minutes.

The loss is intended to work with cached top-k logits: you pre-compute the logits from the teacher model and store only the top-100 logits. In the paper, we show that this produces an almost identical loss to using the full distribution, while requiring significantly less memory and compute.

If you’re interested in the details of how the loss works, we’ve also published a paper on arXiv: https://arxiv.org/abs/2608.03796

Show HN: Dbward – Approval workflows for production databases

https://github.com/dbward-dev/dbward
1•metapox•1m ago•0 comments

Nvidia Nemotron 3.5 Lightning

https://huggingface.co/nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-NVFP4
1•beklein•2m ago•0 comments

Show HN: Lightweight, TypeScript-first mocking library for AWS SDK v3 and Vitest

https://github.com/sudokar/aws-sdk-vitest-mock
2•sudokar•3m ago•0 comments

AMD 'had to re-engineer' the Ryzen 7 5800X3D for a re-release

https://www.tomshardware.com/pc-components/cpus/amd-had-to-re-engineer-the-ryzen-7-5800x3d-for-a-...
1•rbanffy•3m ago•1 comments

Spotify to Label AI Artists on the Platform with New 'AI Persona' Badge

https://www.billboard.com/pro/spotify-label-identify-ai-artists/
1•thm•4m ago•0 comments

Expat 2.8.3 released, fixes vulnerability CVE-2026-72522

https://blog.hartwork.org/posts/expat-2-8-3-released/
1•spyc•5m ago•0 comments

LittleFedi – A Lightweight ActivityPub Server

https://littlefedi.org/
1•wrxd•5m ago•0 comments

Stealing Reasoning Traces from Proprietary LLM APIs

https://stolen-thoughts.com/
1•quantumgarbage•6m ago•0 comments

Show HN: Agent-exchange - messaging and coordination for terminal-based agents

https://github.com/krasserm/agent-exchange
1•cstub•7m ago•1 comments

Discovery could change how scientists measure the universe

https://showme.missouri.edu/2026/mizzou-discovery-could-change-how-scientists-measure-the-universe/
2•geox•7m ago•0 comments

Neutrinos from Deep Inside Earth Provide a New Picture of the Mantle

https://www.quantamagazine.org/neutrinos-from-deep-inside-earth-provide-a-new-picture-of-the-mant...
2•rbanffy•7m ago•0 comments

Show HN: An open-source video editor built for coding agents

https://github.com/diffusionstudio/editor
1•K9-P5•8m ago•0 comments

Chatgpt.com – Degraded Performance

https://status.openai.com/incidents/01KZRE6ZA1RE1ZH4HQ111CX1S8
1•Topfi•8m ago•0 comments

The Open Source AI Popularity Leaderboard from Scarf

https://app.scarf.sh/ai-leaderboard
1•aviaviavi•9m ago•0 comments

Show HN: Parley – let your coding agent ask a teammate's agent

https://parley.weldra.dev
2•tyagivivek•10m ago•0 comments

No Cost, No Value

https://jola.dev/posts/no-cost-no-value
1•shintoist•13m ago•0 comments

I found a KVM guest-to-host heap corruption bug and someone else got there first

https://blog.himanshuanand.com/2026/08/i-found-a-kvm-guest-to-host-heap-corruption-bug-and-someon...
1•unknownhad•14m ago•0 comments

Meta glasses are turning public spaces into surveillance

https://www.theguardian.com/technology/2026/aug/11/meta-glasses-banned-from-courts-in-england-and...
1•BlueBerry2001•14m ago•2 comments

Show HN: Nagomi, Screen Time downtime with more than one period a day

https://nagomi.day/
3•ya5u•14m ago•0 comments

Headless CMS Benefits: Why Headless Architecture Has Become #1 Choice in 2026

https://focusreactive.com/blog/headless-cms-benefits-board-level-infrastructure/
1•katyadrozd•15m ago•0 comments

Show HN: drawtonomy – Draw and run driving scenarios in the browser

https://github.com/kosuke55/drawtonomy
3•kosuke55•17m ago•0 comments

Show HN: HQBase – team email that runs in your Cloudflare account

https://hqbase.io/
2•berman•17m ago•0 comments

Show HN: Vergilant – alerts when your LLM API calls fail, stall, or burn money

https://vergilant.dev
1•arajenk•18m ago•0 comments

News outlets AI fact-checker cannot read

https://korniienko.dev/blog/news-outlets-ai-cannot-read/
1•skorniienko•18m ago•1 comments

Show HN: Alchemize – Review AI Slop PRs Faster

https://tryalchemize.com/
3•robertyhou•21m ago•0 comments

Koala Sampler

https://www.synthtalk.net/articles/marek-bereza-creator-of-the-koala-sampler
1•minimal3•21m ago•0 comments

Show HN: Verity – Permission-aware memory for AI agents

https://github.com/RunAlphaLoop/verity
2•mcfdoesdev•21m ago•0 comments

Show HN: Seal – Open-source P2P encrypted chat in Rust and Tauri

https://github.com/Emn4tor/Seal
2•emn4tor•24m ago•0 comments

The power (and weakness) of Narrative in Biotech

https://agapow.substack.com/p/the-power-and-weakness-of-narrative
1•nnmg•25m ago•0 comments

DALT: Depreciation-Assisted Land Value Tax

https://progressandpoverty.substack.com/p/dalt-depreciation-assisted-land-value
1•surprisetalk•26m ago•0 comments