Mingtao Xu (@MtX9) header
Mingtao Xu (@MtX9) profile picture

A professor @Tsinghua_Uni @SEM_Tsinghua. #Strategy, #Innovation, #PropertyRights, #IPR #AI. All views are my own. mtxu@mastodon.world

Joined November 2012
Photo by Mingtao Xu (@MtX9)Photo by Mingtao Xu (@MtX9)Photo by Mingtao Xu (@MtX9)Photo by Mingtao Xu (@MtX9)Photo by Mingtao Xu (@MtX9)Photo by Mingtao Xu (@MtX9)Photo by Mingtao Xu (@MtX9)Photo by Mingtao Xu (@MtX9)Photo by Mingtao Xu (@MtX9)Photo by Mingtao Xu (@MtX9)
Please join us (co-organized with Maria Roche and Jordan Bisset) for the 24th edition of The Patent PDW: Advances in Patent Research, New Data, Measures and Methods. #AOM #Patents #Innovation #Research All-star presenters (Gerard Hoberg, Dietmar Harhoff, Lee Fleming & Jiao Luo)
1
164
and discussant (Shane Greenstein and Florenta Teodoridis @florentaT ) team will be sharing exciting new work on and using patents. This will be a fun and informative session! We look forward to seeing you all there in Philly!
51
This is a really elegant, beautiful paper, and a good introduction to moment inequalities. Walmart places stores close together, even though they cannibalize sales from each other. Why? Clearly, they must be more efficient with density -- but by how much?
3
10
1
114
9,961
Stanford CS336 上,Tatsu 讲了一节 LLM 架构课,把过去 3 年所有主流 LLM 拆开,看它们的共通模板 结论挺爆:90% 的架构选择已经收敛,你随便挑一个开源大模型,它跟其他模型在这些维度上几乎一模一样 讲师的原话 - 2024 年大家都在 cosplay Llama2 - 2025 年的主题是「怎么训得不崩」 - 2026 年的主题是「怎么扛住长上下文」 下面是 2026 年开源 LLM 的标准模板 你训自己的模型可以直接抄 【架构层 已经收敛的 7 件事】 1)Layer Norm 挪出残差流(pre-norm) 原版 Transformer 把 LN 放在残差里 几乎所有现代模型都挪到外面 原因:keep your residual stream clean 梯度反传更稳 2)RMS Norm 替代 LayerNorm LayerNorm 的减均值 + 加 bias 那部分实际没怎么帮上忙 丢掉之后 flops 只省 0.17% 但运行时省到 25% (瓶颈在数据搬运 计算反而次要) 3)所有 bias 项全删 跟 RMS Norm 一个道理 系统层省内存搬运 4)激活函数用 SwiGLU 或 GeGLU gated linear unit 几乎所有现代模型都用 Llama 系 / Qwen / Mistral 用 SwiGLU Google 系(Gemma / T5)用 GeGLU 区别极小 选哪个都行 5)位置编码用 RoPE 2024 年之后基本统一了 原理:把每对维度按位置旋转一个角度 让 inner product 只依赖相对位置 6)Transformer block 串联(不是并联) GPT-J / Palm 试过并联 现在基本被放弃 串联的实现优化得太好了 并联省的那点系统开销不值得损失表达力 7)Layer norm 可以「撒」 哪儿不稳就在哪儿加 LN attention 之前能加 之后能加 两边都加(double norm)也可以 现代模型很多这样做 【超参数 已经收敛的 5 个数】 1)feedforward 维度 / hidden 维度 - 非 GLU 模型:4 倍 - GLU 模型:8/3 ≈ 2.67 倍(因为 GLU 多一组矩阵 要保持总参数量) - Llama 系:3.5 倍 - T5 1.0 试过 64 倍 后来 T5 1.1 改回标准 别学 2)head 数 × head 维度 ≈ hidden 维度 几乎所有模型都遵守 T5 是为数不多的例外 3)模型纵横比(hidden / 层数)≈ 100 太深 pipeline parallel 难做 太宽 表达力受限 100 这个数字是系统约束 + 表达力的平衡点 4)vocab size 单语模型:30K 左右(早期 GPT-2 那种) 多语 / 通用模型:100K-200K(GPT-4 / Llama 3 / Gemma 都在这个范围) 现代基本都是后者 5)weight decay 仍然普遍使用 但研究发现它在 LLM 里干的事其实是优化器干预 让你最终能收敛到更深的最优点 跟你想的「防过拟合」没什么关系 所以别因为「单 epoch 不会过拟合」就把它关掉 【稳定性 三个救命 trick】 训练大模型最怕中途 loss 突然飙升 然后 NaN 全军覆没 现代模型用三个 trick 防这件事 1)Z-loss output softmax 的 normalizer 容易爆 加一个 (log Z)² 的正则项 让 Z 始终接近 1 DCLM / Olmo 都用 2)QK norm attention 的 Q 和 K 在矩阵乘之前各加一个 LN 让 softmax 的输入永远是单位尺度 multimodal 圈先用起来 现在所有大模型都加 3)Logit soft cap(仅 Google 系) attention logit 用 tanh 硬封顶 Gemma 2/3/4 都在用 但会损失一点点性能 慎用 【Attention 两个新趋势】 1)GQA(Grouped Query Attention)几乎统一 原版 multi-head 推理时 KV cache 会让算术强度崩到 1/h GQA 共享 K 和 V 但保留多个 Q 表达力几乎不损失 推理成本砍掉 80% 现在所有要做生产部署的大模型 没有不用 GQA 的 2)局部 + 全局 attention 交替 处理长上下文的新方式 Cohere Command A 起头 现在 Llama 4 / Gemma 4 / Olmo 3 全在用 比如每 4 层有 1 层 full attention 其他 3 层是 sliding window 只看附近的 token 比纯 SSM 更稳 比纯 full attention 便宜得多 (Qwen 3.5 做了变体 把 sliding window 那 3 层换成 SSM) 收尾一句 如果你正在训自己的 LLM,上面这一套就是 2026 年的「默认配置」 不需要重新发明,直接抄 如果你只是想看懂 GitHub 上那些 modeling_xxx.py 这一份足够你不再被术语吓住
Anthropic pays $750,000+ a year for engineers who can build LLM architectures from scratch. Stanford taught the entire thing in 1 hour lecture & released it for free. Bookmark & watch this today before someone takes it down.
Readers added context they thought people might want to know
The video is Lecture 3 on architectures and hyperparameters from Stanford's 19-lecture CS336 course "Language Modeling from Scratch," which covers the full process including data, training, and evaluation; one lecture does not teach building LLMs from scratch. youtube.com/watch?v=ptFiH_… stanford-cs336.github.io/spring2025/
29
582
21
3,043
547,634
Mingtao Xu retweeted
Great to see our recent @JAMA_current article (with @SoyeonKang_PhD) featured in @Bloomberg --- appreciate the thoughtful coverage by @julianaliu.
1
2
4
485
Mingtao Xu retweeted
1
31
2
207
15,035
Mingtao Xu retweeted
1/ Happy to release StatsClaw — an open-source multi-agent workflow for building statistical software with AI. w/ @qintianzhu Site: statsclaw.ai Paper: bit.ly/statsclaw
11
124
9
447
54,756
Mingtao Xu retweeted
📢 New Research with @SoyeonKang_PhD in @JAMA_current: Early-stage drug development worldwide has nearly doubled over the past decade and is shifting from a U.S.-dominated model to a dual-hub model centered in the United States and China.
From 2015 to 2024, the number of early-stage drug development programs worldwide increased by more than 80%, with pronounced growth in China and a relative decline in the US and other high-income countries. 🧵 ja.ma/4rULaL2
2
2
7
380
Mingtao Xu retweeted
Evidence that AI models can, indeed, learn "taste" in this paper where a small model, trained on citations, is able to predict which papers will be hits Citations, upvotes & shares are signals that can teach AI judgment about quality, not just execution. arxiv.org/pdf/2603.14473
48
53
13
410
37,146
Mingtao Xu retweeted
This paper just came out in the American Economic Review. One of my favorite findings was that people who experienced more economic growth while growing up had less "zero-sum" attitudes as adults.
A new paper on correlates of zero-sum thinking just came out and it has everything: race, sex, politics, class, mobility, and even deep roots! Here are my favorite graphs from the paper. But first: how was zero-sum thinking measured? The answer is as a set of four questions on whether things are zero-sum with respect to ethnicity ("If one ethnic group becomes richer, this generally comes at the expense of other groups in the country"), citizenship ("If those without American citizenship do better economically, this will generally come at the expense of American citizens"), trade ("In international trade, if one country makes more money, then it is generally the case that the other country makes less money"), and income ("If one group becomes wealthier, it is usually the case that this comes at the expense of other groups"). Endorsement of these ideas is considered zero-sum thinking. Because these can feel political, you might think that would compromise the results. And true! Measurement invariance wasn't tested, but removing mechanically-related questions didn't seem to change this paper's findings much. Onto the graphs! The first one I liked was on the demographics of zero-sum thinking. It's a young and middle-aged person's game, but it's also a game for Hispanics and Blacks, but not Asians, for Democrats and not Republicans, for urbanites, somewhat for ruralites, and not as much for suburbanites, and there are U-shaped relationships with income and education. There are lots of findings in the break-downs of these categories, like that Democrats who voted for Trump were often highly zero-sum thinkers, or that zero-sum thinking is simultaneously related to - The belief that luck trounces effort - The perception that mobility is high - Universalist values - A belief in the importance of tradition - Generalized trust A second finding I found extremely interesting was that people who experienced more growth in the first twenty years of their lives had less zero-sum values. Because of the correlation between growth and zero-sum thinking over time and compositional changes that covary with those changes, it's important to do some post-stratification to see if this result really holds up. If it does, it has fascinating implications. The paper is really chock-full of fun facts, like that, globally, right-wingedness is related to less zero-sum thinking, but in some countries, the relationship is nullified or reversed. Another finding was that being anti-immigrant and pro-redistribution was related to zero-sum thinking among Democrats, and even more strongly, among Republicans. Yet another finding was that parental, grandparental, and great-grandparental mobility was negatively related to zero-sum thinking. A more immigrant-focused finding was that later-generation immigrants are closer to non-immigrant levels of zero-sum thinking. That is, they become more zero-sum! More likely there's selection at play, but regardless, immigrants are less zero-sum and this held up in the 2nd and 3rd generations, too. It was also found that county foreigner shares were unrelated to zero-sum thinking in respondent's generation or their parent's generation, but they were negatively related in their grandparent's generation. Another intergenerational transmission of values question had to do respondents' self-identification of having ancestors who experienced different bouts of slavery. The descendants of African slaves, Holocaust survivors, indentured servants, interned Japanese Americans, and enslaved Amerindians were more likely to be zero-sum thinkers. The same was not true for the descendants of prisoners of war. Unlike with immigration, the zero-sum correlates of enslavement seem more robust. For example, a person's county enslaved share in 1860, their parent's county enslaved share in 1860, and their grandparent's county enslaved share in 1860 all correlated with zero-sum sentiment. This remained true for people, their parents, and their grandparents if they moved out of the American South! Additionally, these findings also held true for each level when it came to county Confederate culture. In other words, the transmission of values, even with controls for demographics, state, and race was robust! This study paints a vivid picture of the correlates of zero-sum thinking in the present day, internationally, and with respect to their roots in the deep past. I definitely recommend reading it! Go check it out: nber.org/papers/w31688
13
76
6
787
66,592
Mingtao Xu retweeted
Replying to @alexolegimas
It's in my slide deck for today!
1
10
1
58
4,673
That’s exactly what we find in our paper! Firms that adopt GenAI reduce the number of junior employees, and this effect operates entirely through a decline in hiring rather than increased separations. Link to draft: papers.ssrn.com/sol3/papers.…
My hypothesis is that AI will lead to less dramatic layoffs (e.g., the Block memo) and more a slower drip: companies will continue to fire at similar rates, but will hire at much slower rates. Those who are left will be expected to use AI tools--to figure it out--in order to pick up the slack from those who were let go. This will naturally lead to AI models being adopted effectively throughout organizations. But the labor market implications for the economy are in some ways more dire than the dramatic scenario: exactly the type of slow drip of increasing unemployment and lower labor force participation that policy has the hardest time dealing with (policy is much better when there is a clear demarcated disaster).
19
172
28
1,259
205,323
Mingtao Xu retweeted
If you don't have time to read the 113 page paper, you should at least read this thread by @ccatalini
1/ Some Simple Economics of AGI—🔥🧵 Right now, there is a low-grade panic running through the economy. Everyone is asking the same anxious question: what exactly is AI going to automate, and what will be left for us?
2
5
26
9,734
Mingtao Xu retweeted
🤖 Can LLMs replicate expert text coding? ➡️ Using interest group documents, @dchoiresearch @DenisPeskoff & @b_m_stewart show that fine tuned LLMs outperform trained coders and zero shot models in identifying informative vs associative signals cambridge.org/core/journals/… #FirstView
19
66
5,262
Mingtao Xu retweeted
A lot of the AI productivity data either comes from controlled "micro" studies or noisy aggregate data. A new paper presents data from huge survey of *firms*, i.e., CEO and CFOs. This is exactly the type of data many of us have been waiting for. Lots of important results both on current adoption/employment consequences of AI, and future forecasts. Currently: 1. AI has some adoption across 70% of firms. 2. Some cross-country differences. US adoption towards top end (78%), Australia towards bottom (59%). 3. ~70% of executives use AI, but only around 1.5 hours a week. 4. Large majority of execs report essentially zero productivity boost from AI. Perhaps not super surprising given how recently it's been adopted. 5. Essentially zero impact on employment. Forecasts (large effects): 1. Execs predict large productivity gains over next three years, more than 2% in US, closer to 1% in Germany, Australia. 2. Execs predict negative employment effects, eg -1.19% in the US. 3. Interestingly, Accommodations and Food/ Wholesale and Retail are expected to have largest drops in employment (2%) 4. Employment forecasts are becoming *more* negative over time. Lots of great stuff in the paper, kudos to the team.
11
66
10
257
41,009
Mingtao Xu retweeted
You can add coffee stains to your LaTeX documents. 👇 ctan.org/pkg/coffeestains
28
399
66
4,156
229,061
Mingtao Xu retweeted
Claude can make blue1brown animations in minutes. Education is about to explode.
289
1,096
151
13,519
1,415,023
The simplest way to visualize the set of numbers.
9
192
5
1,017
35,883
Here is the geolocation of people using GitHub to code. Paper here: science.org/doi/10.1126/scie… This research project (@johannes_wachs, @FrankNeffke, @simone_daniotti, @xiangnan_feng), is expanding in various directions. Geography is one of them. Data is 30 million+ GitHub commits
3
32
2
163
15,763