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

推荐订阅源

J
Java Code Geeks
G
Google Developers Blog
有赞技术团队
有赞技术团队
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Blog — PlanetScale
Blog — PlanetScale
罗磊的独立博客
博客园 - 聂微东
V
Visual Studio Blog
博客园_首页
D
DataBreaches.Net
腾讯CDC
I
InfoQ
F
Fortinet All Blogs
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 【当耐特】
Google DeepMind News
Google DeepMind News
人人都是产品经理
人人都是产品经理
云风的 BLOG
云风的 BLOG
月光博客
月光博客
Recent Announcements
Recent Announcements
MongoDB | Blog
MongoDB | Blog
C
Check Point Blog

Hacker News: Show HN

PurrrrrFocus: Pomodoro Timer App - App Store Workflow Engine — Multi-Step Orchestration for Bun RapidPhoto: Pro Photo Editor App - App Store GitHub - DheerG/swarms: Achieve extraordinary results with claude code across a variety of tasks SPICE simulation → oscilloscope → verification with Claude Code — Lucas Gerads Show HN: VCoding – A 5 MB native Windows IDE with no dynamic dependencies Show HN: LLMs don't hallucinate because they're bad at math, it's the format GitHub - Agent-FM/agentfm-core: AgentFM is a peer-to-peer network that turns everyday computers into a decentralized AI supercomputer. AgentFM lets you run massive AI workloads directly across a global mesh of idle CPUs and GPUs. Show HN: Tracking Top US Science Olympiad Alumni over Last 25 Years GitHub - Potarix/agent-hub: One place to talk to all your agents Show HN: Runtime security for AI agents(injection,tool abuse, data exfiltration) GitHub - dubeyKartikay/lazyspotify: Terminal Spotify client for macOS and Linux GitHub - the-banana-tool/king-louie: Easy to use GUI Personal AI Assistant. Win/Linux/Mac. Show HN I made my vacation rental bookable by AI agents–no Airbnb, 0% commission GitHub - basteez/jsf-autoreload: maven plugin to enable hot reload on jsf projects uvm32/hosts/host-gdbstub at main · ringtailsoftware/uvm32 GitHub - labsai/EDDI: Config-driven engine that turns JSON into production-grade AI agents. Multi-agent orchestration, 12+ LLM providers, MCP/A2A protocols, RAG, persistent memory, and enterprise compliance (EU AI Act, GDPR, HIPAA). Built on Quarkus. GitHub - glitchnsec/fortyone-oss: AI Executive Assistant Platform Quickstart | Alien GitHub - muxshed/shed: One stream in, or many. Every destination, simultaneously. No cloud middleman, no per-channel fees, no limits. GitHub - ocrbase-hq/ocrbase: 📄 PDF/IMG ->.MD/JSON Document OCR API for PaddleOCR and GLMOCR. Self-hostable. GitHub - impactjo/home-memory: MCP server that lets your AI assistant remember everything about your home. GitHub - Sets88/dbcls: DbCls is a powerful terminal database client that supports various databases GitHub - neptun2000/heor-agent-mcp GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh RollQuation: Math Puzzles - Apps on Google Play GitHub - dropbox/witchcraft Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis GitHub - opentalon/opentalon: OpenTalon is an open-source platform built from the ground up in Go as a robust alternative to OpenClaw LinkedIn™ 职位抓取工具 - Chrome 应用商店
Building My Own Diffusion Language Model
encrux · 2026-04-30 · via Hacker News: Show HN
To be, fo hend!

First her sense ountier to Jupits,

be horse.

Wise words! This is the results of 2 hours of training my very own PyTorch Diffusion Language Model on an M2 MacBook Air.

You can check out the code over at GitHub: github.com/Encrux/simple_dlm

Why?

Diffusion Language Models are kind of a hot-topic right now in Machine Learning. The basic idea: corrupt some data with noise, then train a model to reverse that corruption over many small steps.

They’re used in a variety of domains, most notably in image synthesis. Image generation algorithms like Stable Diffusions treat this as a continuous problem on a per-pixel basis, because a pixel value of 134 is close to 135. For text, this principle is not as straight forward, because the latter “A”, which would convert to 65 is in no meaningful interpretation closer to “B” (ascii 66) than “Z” (ascii 90). The fix is to give up on numeric noise altogether. We corrupt the sequence by replacing tokens with a [MASK] token, and let the model learn to predict what was there.

This feels nothing like the physical noise picture, but it’s still proper diffusion math under the hood.

Diffusion vs autoregressive

Pretty much any LLM currently in use is decoding tokens autoregressively, so why care about diffusion? Autoregressive models force left-to-right decoding by design. With diffusion, we can decode the entire sequence in parallel and reach a low entropy state (i.e. actual text) by repeated denoising over the same sequence.

Autoregressive T o b e , f o h e n d ! F i r s t h e r s e n s e o u n t i e r t o J u p i t s , b e h o r s e . Diffusion (20 steps) T o b e , f o h e n d ! F i r s t h e r s e n s e o u n t i e r t o J u p i t s , b e h o r s e .

In theory, this can yield significantly higher tokens per second. Models like Mercury2 are working towards demonstrating this in the real world.

Training loop

For training, we grab a random 128-char chunk from the training data and sample a random masking probability mask_prob ~ U(0, 1). This fraction is replaced with the [MASK]-token.

After the forward pass, we train the model using cross-entropy loss on only the masked tokens. Mask_prob itself also gets passed into the model as an input. That’s what lets one network handle every noise level, from a barely-masked sequence to a fully-masked one.

ground truth t o · b e , · o r · n o t · t o · b e apply random mask (mask_prob ~ U(0,1)) masked input o · b e · o · n o t · t · b e mask_prob = 0.4 Transformer × 10 predicted t o · b e , · o r · n o t · t o · b e loss = cross-entropy(predicted, ground truth) on the 4 masked positions only

Sampling

For decoding, we begin by setting all tokens to [MASK]. We then run k denoising steps, committing more tokens each time, until the sequence is fully revealed. In this example, k = 20.

step 0 — prompt + all masks t o · b e , · Transformer + sample some masked positions (mask_prob = 1.00) after step 6 t o · b e , · n o b Transformer + sample some masked positions (mask_prob = 0.70) after step 13 t o · b e , · r · n · t o · b Transformer + sample some masked positions (mask_prob = 0.35) step 20 — done t o · b e , · o r · n o t · t o · b e

What undertraining sounds like

Step 67k, loss 1.22:

To be, and be of men?

Prown AMEN:

O yout aboars of

Ra':

Un

Step 77k, loss 1.09:

To be, fo hend!

First her sense ountier to Jupits,

be horse.

The output is obviously mostly nonsense, but the fact that it learned to ouptut real words and strings that resemble actual sentences even a tiny bit is quite impressive considering the hardware it has been trained on. Tokens are encoded per-character, so the model had to learn this from scratch.

Stepping back

This write-up is barely scratching the surface. The different flavors of language models keep increasing in numbers. I didn’t address shortcomings like actual model performance, fixed decoding lengths and how these are (or could be) addressed.

There’s a lot of scary buzz words floating around in the age of AI. Projects like these help me make sense of key concepts that I think are worth knowing about. I think diffusion models are fascinating. In the future, I definitely want to learn more about their inner workings, especially when it comes to multi-modal models.


References