Hugging Face Blog其他AI

DiScoFormer:一個適用於不同分佈的密度與分數Transformer

2026年6月29日 18:02

重點摘要

機器學習和科學中的許多問題最終都歸結為同一項任務:你有一組數據點,想要恢復它們所來自的分佈——哪些值是常見的,哪些是罕見的。確定該分佈意味著估計兩個量:分佈的密度,以及更實用的(隨著維度增加)分數。密度是直方圖的平滑版本——在點聚集處高,在點稀少處低。分數——對數密度的梯度——指向密度上升最快的方向:沿著分數移動一個點...

站內 AI 整理稿

Back to Articles DiScoFormer: One transformer for density and score, across distributions Enterprise Article Published June 29, 2026 Upvote 1 Kyle Wiggers Ai2Comms Follow allenai 📄 Tech report: arxiv.org/abs/2511.05924 Many problems in machine learning and the sciences come down to the same task: you have a collection of data points and want to recover the distribution they came from—which values are common, and which are rare. Pinning down that distribution means estimating two quantities: the distribution's density and, more useful as dimensionality grows, its score. The density is the smooth version of a histogram—high where points cluster and low where they're scarce. The score—the gradient of the log-density—points in the direction the density rises fastest: move a point along the score and it heads toward a more probable region. Diffusion-based generative models (the technology behind AI image generators like Stable Diffusion and DALL-E) start from random noise and repeatedly follow the score, turning that noise into a realistic image. The same score drives Bayesian sampling and the particle simulations used to model systems such as plasma. Extracting the density and score from a finite sample is challenging, and today's tools force a trade-off between generalizability and accuracy. One classical approach, kernel density estimation (KDE), computes the density at any location from the data points around it: the closer and more numerous they are, the higher the density. It needs no training and applies to any distribution, but its accuracy falls off sharply as dimensionality grows. Alternatively, neural score-matching models trained to predict the score stay accurate even in high dimensions, but each needs to learn the distribution and must be retrained from scratch for another. We introduce a new solution called the DiScoFormer (Density and Score Transformer)—one model that, given a set of data points, estimates both the density and the score of the distribution in a single forward pass without retraining. Training a transformer for density and score estimation DiScoFormer maps an entire sample to the density and score of the distribution behind it using stacked layers of transformer blocks. The model utilizes cross-attention, which allows it to evaluate density and score at any point—not just where you have data. Score and density share a mathematical relationship: score is the gradient of the logarithm of density. We leverage this by having a shared backbone with two output heads, one for the density and one for the score. This coupling does more than save parameters. The score head has to match the gradient of the log-density head at every query, so any gap between them is a label-free consistency loss. We use this at inference—hold the context fixed, take a few gradient steps on that consistency loss, and DiScoFormer adapts itself to an out-of-distribution input on the spot, no ground-truth density or score required. There's a mathematical reason why the transformer architecture fits this task. Kernel density estimation has a single bandwidth—how far each point's influence reaches, fixed in advance and applied identically everywhere. Attention is a strict generalization of it: we analytically show that a single attention head's weights are nearly a Gaussian kernel over the data, so one cross-attention block can already reproduce KDE's density and score. From there the model goes further, learning several such scales at once and adapting them to the data. DiScoFormer doesn't discard the classical method for a black box but instead includes KDE as a special case and improves on it. What data did we use to train DiScoFormer? We relied on Gaussian Mixture Models for two primary reasons. Firstly, GMMs are universal density approximators—with enough components they match essentially any smooth distribution to arbitrarily small error. Secondly, GMMs have closed-form densities and scores, so we always have an exact target to supervise against. We employ both of these properties by drawing a new GMM for every batch, giving the model virtually unlimited examples of target distributions and supervising each against a given GMM's exact density and score. Performance Across the board, DiScoFormer beats KDE at both density and score estimation, and the gap widens exactly where KDE struggles. In 100 dimensions, it isn't close—against the best hand-tuned KDE, it cuts score error by about 6.5x and density error by more than 37x, and it keeps improving as you add samples, while KDE runs out of memory. It also travels far outside its training data, staying accurate on mixtures with more modes than it ever saw during training and on non-Gaussian shapes like the Laplace and Student-t. KDE's main advantage remains speed, especially when datasets are small. The part about DiScoFormer that we find most promising is that score estimation is a shared dependency across many fields, such as generative modeling, Bayesian inference, and scientific computing. A pretrained, plug-in estimator that stays accurate in high dimensions and removes the need to retrain per problem could cut that cost across all of them at once—one model, reused everywhere score and density show up. We encourage you to read our technical report for more details. More from this author Which tokens does a hybrid model predict better? 8 June 25, 2026 MolmoMotion: Language-guided 3D motion forecasting 10 June 17, 2026 Community EditPreview Upload images, audio, and videos by dragging in the text input, pasting, or clicking here. Tap or paste here to upload images Comment · Sign up or log in to comment Upvote 1

Related

相關文章

數據中心吃人事件:科技行業正在抽乾全球的水資源

這篇消息聚焦「數據中心吃人事件:科技行業正在抽乾全球的水資源」。原始導語提到:這是屬於我們這個時代的“羊吃人事件” 從 AI 情報角度來看,這類內容值得關注其背後的技術進展、產品落地、產業競爭與後續市場影響。

1 小時前

AI對硬件揠苗助“漲”

這篇消息聚焦「AI對硬件揠苗助“漲”」。原始導語提到:內存飛漲,哪家都扛不住了 從 AI 情報角度來看,這類內容值得關注其背後的技術進展、產品落地、產業競爭與後續市場影響。

3 小時前

AI當老闆,快給10家公司幹破產了…

這篇消息聚焦「AI當老闆,快給10家公司幹破產了…」。原始導語提到:Fable 5,全球最強「硅基CEO」 從 AI 情報角度來看,這類內容值得關注其背後的技術進展、產品落地、產業競爭與後續市場影響。

4 小時前
量子位其他AI

AI當老闆,快給10家公司幹破產了…

這篇消息聚焦「AI當老闆,快給10家公司幹破產了…」。原始導語提到:畫出那個矩陣的能力——還屬於人類。 從 AI 情報角度來看,這類內容值得關注其背後的技術進展、產品落地、產業競爭與後續市場影響。

5 小時前
IT之家其他AI

谷歌 Play 版小米米家 App 將未來不再支持中國大陸地區服務

據用戶反饋,谷歌 Play 商店下載的米家 App 設置頁面出現提示,因區域服務政策調整,後續版本將不再支持中國大陸地區服務,建議用戶下載使用大陸版。該版本最近更新於 6 月 16 日,新增了自動化操作按週期循環執行等功能。#小米米家# #谷歌 Play#

6 小時前

WAIC 2026 × 36氪「氪話未來直播間」:帶著AI去前線

這篇消息聚焦「WAIC 2026 × 36氪「氪話未來直播間」:帶著AI去前線」。原始導語提到:2026WAIC舉辦,36氪將設「氪話未來直播間」 從 AI 情報角度來看,這類內容值得關注其背後的技術進展、產品落地、產業競爭與後續市場影響。

9 小時前