with one click
ai-paper-reader
深度解析 AI 论文,生成可直接发布的专业阅读笔记
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
深度解析 AI 论文,生成可直接发布的专业阅读笔记
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Builds a self-contained multi-source trending / hot-topic Markdown digest for any subject (AI, gaming, crypto, research, news, ...). Pulls fresh content in parallel from X/Twitter, Hacker News, Reddit, GitHub trending, arXiv, 微博 (Weibo), 36kr — plus any new source modules you drop into scripts/sources/. Use this skill whenever the user asks to find trending/hot/popular content on a topic, monitor what people are saying across social media or news sites, build a "top N posts" digest, aggregate AI/tech/research signals into a report, summarize cross-platform discussion, track Chinese (国内) + international (国外) coverage of an event, or curate a multimedia weekly digest with embedded images and videos. Triggers on phrases like "find hot posts about X", "X 热门帖", "trending now on AI", "monitor what people are saying about Z", "整理热点", "AI 资讯汇总", "Twitter + HN + Reddit trending report", "中文 + 英文 热点", "tech news roundup", "summarize discussion across platforms". The skill ships ready-made scrapers for 7 sources and is
Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, or extract information from web pages.
Emit HTML reports (not Markdown) when the user asks for a structured report, analysis, plan, status, write-up, or dashboard. Loads a shared CSS shell from references/base-template.html and a 12-layer Claude-report skeleton from references/claude-report.html so output is body-only HTML (~40-55% token saving vs inline-CSS HTML). Use when the user requests: 报告/分析报告/调试报告/实现计划/状态报告/周报/日报/PR write-up/incident report/research explainer/dashboard; OR when output benefits from rich layout (cards, tables, stat bands, timeline, checklist, SVG, diff blocks). Do NOT trigger for: 简单回答/单段解释/纯代码片段/单 table 速查 — Markdown stays cheaper there.
Audit and improve CLAUDE.md files in repositories. Use when user asks to check, audit, update, improve, or fix CLAUDE.md files. Scans for all CLAUDE.md files, evaluates quality against templates, outputs quality report, then makes targeted updates. Also use when the user mentions "CLAUDE.md maintenance" or "project memory optimization".
Use when the user wants to BUILD a UI (page, component, dashboard, landing,
End-to-end methodology for distilling repetitive workflows into reusable automation. Mines conversation history and codebase for repeated patterns, implements project-specific automation, then extracts cross-project universal templates with sanitization and parameterization. Triggers when user mentions identifying repetitive operations, building reusable automation, extracting universal templates, finding what's worth automating, distilling workflows, asks "what can be automated" across a project, or wants to review/retire existing automation.
| name | ai-paper-reader |
| description | 深度解析 AI 论文,生成可直接发布的专业阅读笔记 |
生成可直接发布到技术社区的论文阅读笔记(知乎、掘金、公众号等)。
笔记要求:
专业准确的表述
深入浅出的解释
结构清晰的组织
有价值的深度分析
AI 套话和模板句式
空洞的总结和评价
过度的格式装饰
不必要的第一人称
每篇笔记开头需包含以下信息,帮助读者快速判断是否继续阅读:
> **论文**:Actions Speak Louder than Words: Trillion-Parameter Sequential Transducers for Generative Recommendations
> **作者**:Meta AI
> **发表**:ICML 2024
> **阅读时长**:约 15 分钟
> **难度**:⭐⭐⭐⭐ (需要 Transformer、推荐系统基础)
> **前置知识**:Attention 机制、DLRM、Scaling Law 概念
难度等级说明:
用 2-3 句话概括论文的核心创新,让没时间细读的读者快速抓住重点。
## TL;DR
DLRM 等传统推荐模型依赖大量人工特征且无法 scale,本文提出将推荐问题转化为序列生成问题。核心创新是 HSTU 架构:用 Pointwise Attention 替代 Softmax 来保留用户偏好的绝对强度信息,使推荐系统首次展现出类似 LLM 的 Scaling Law。
要求:
简明扼要地回答三个问题:
## 论文概述
**问题**:大规模推荐系统无法像 LLM 一样通过增加计算量持续提升质量
**方案**:将推荐问题从"特征工程+判别式模型"转变为"序列建模+生成式模型"
**贡献**:
1. 提出 Generative Recommenders (GRs) 范式,实现推荐系统的 Scaling Law
2. 设计 HSTU 架构,用 Pointwise Attention 替代 Softmax 保留强度信息
3. 提出 M-FALCON 推理算法,实现高效的候选打分
说明现有方法的问题,以及为什么需要新方法:
这是笔记的核心部分,要求完整、深入、不遗漏。
整体架构
核心模块详解(对每个关键模块)
关键技术细节
## 核心方法
### 整体架构
[架构图]
数据流:用户历史序列 → Embedding → HSTU Layers × L → 预测头
### HSTU Layer 详解
#### 输入输出
- 输入:X ∈ R^{N×d},N 为序列长度,d 为嵌入维度
- 输出:Y ∈ R^{N×d}
#### 核心公式
**Pointwise Projection**:
$$U, V, Q, K = \text{Split}(\phi_1(f_1(X)))$$
其中:
- $\phi_1$:SiLU 激活函数
- $f_1$:单层线性变换
- Split 将输出分为四个向量
**Spatial Aggregation**:
$$A(X)V(X) = \phi_2(Q(X)K(X)^T + r_{ab}) V(X)$$
关键点:使用 SiLU 而非 Softmax,保留注意力的绝对强度信息。
#### 代码实现
```python
class HSTULayer(nn.Module):
def forward(self, x):
# Pointwise Projection
projected = F.silu(self.proj_in(x))
u, v, q, k = projected.split([...], dim=-1)
# Spatial Aggregation (不是 Softmax!)
attn = F.silu(q @ k.T + self.rel_bias)
out = self.norm(attn @ v) * u
return x + self.proj_out(out)
为什么用 SiLU 而不是 Softmax?
Softmax 会将注意力归一化到概率分布,这在推荐场景下会丢失重要信息...
### 五、实验分析
不是罗列数字,而是提炼关键结论:
- **主实验结果**:与 baseline 对比的核心发现
- **消融实验**:各组件的贡献分析
- **Scaling 分析**:计算量与性能的关系(如有)
- **局限性**:方法在什么情况下效果不好
### 六、深度理解问答
通过精心设计的问题,帮助读者深入理解论文的关键点。
**问答直接展示,不使用折叠**。
```markdown
## 深度理解问答
### Q1: 为什么 Softmax Attention 不适合推荐场景?
推荐场景需要预测用户偏好的**绝对强度**(如观看时长),而非只是**相对排序**。
考虑两个用户:
- 用户 A:10 次历史交互
- 用户 B:100 次历史交互
使用 Softmax 时,两者的注意力权重都会被归一化到 [0,1],导致"用户 B 更活跃"这一信息丢失。
而 Pointwise Attention 保留了累加的原始 magnitude,模型可以学到活跃度差异。
### Q2: HSTU 如何用 2 个线性层替代 Transformer 的 6 个?
标准 Transformer 每层需要:
- Q, K, V 投影:3 个线性层
- Output Projection:1 个线性层
- FFN:2 个线性层(扩展+压缩)
HSTU 的简化:
1. **融合 Q, K, V, U 投影**:一个线性层同时生成四个向量
2. **用 U 门控替代 FFN**:`output * U` 实现类似的非线性变换
代价是单层表达能力下降,但可以通过堆叠更多层来补偿。
### Q3: Stochastic Length 训练为什么能丢弃 70% token 而效果几乎不变?
关键在于用户行为的**统计特性**:
1. **时间重复性**:用户会反复与相似内容交互,信息冗余度高
2. **兴趣低秩性**:10000 次交互可能只涉及 20 个主要兴趣点
3. **最近优先**:采样时对最近行为加权,保留最相关的信息
只要采样数量大于兴趣类别数的一定倍数,就能以高概率覆盖所有兴趣。
客观总结论文的贡献和局限:
## 总结
### 核心贡献
- 证明了推荐系统可以遵循 Scaling Law
- 提出了适合推荐场景的 Attention 变体
### 局限性
- 冷启动场景:历史序列太短时优势不明显
- 计算成本:需要大量 GPU 资源
- 实时性:长序列推理的延迟挑战
### 适用场景
- 用户历史丰富的场景(>100 次交互)
- 有充足计算资源
- 对实时性要求不是极端严格
论文和阅读笔记应组织在统一的子目录下,便于管理和检索:
paper-notes/
├── hstu/ # 每篇论文一个目录,使用简短名称
│ ├── paper.pdf # 原始论文 PDF
│ ├── README.md # 阅读笔记(主文件)
│ └── images/ # 提取的图表
│ ├── fig1_architecture.png
│ ├── fig2_method.png
│ └── fig3_scaling.png
│
├── attention-is-all-you-need/
│ ├── paper.pdf
│ ├── README.md
│ └── images/
│
└── din-deep-interest-network/
├── paper.pdf
├── README.md
└── images/
命名规范:
- 连接README.md,便于 GitHub 直接预览images/图片命名规范:
fig{序号}_{类型}_{简述}.png
类型:
- arch: 架构图
- method: 方法流程
- result: 实验结果
- ablation: 消融实验
- compare: 对比图
示例:
- fig1_arch_overall.png
- fig2_method_attention.png
- fig3_result_scaling.png
原理理解类
细节辨析类
边界条件类
延伸思考类

**图示内容**:HSTU 的整体架构,左侧为 DLRM 对比
**关键信息**:
- 输入为统一的物品-行为交替序列
- HSTU Layer 可以无限堆叠
- 输出为多任务预测头
**与正文对应**:第 3.2 节详细描述
学术论文中的图表有两种类型,需要不同的提取方式:
| 类型 | 特点 | 提取方法 |
|---|---|---|
| 嵌入式图片 | 作者插入的 PNG/JPEG | get_images() |
| 矢量图形 | 架构图、流程图等绘制的图形 | cluster_drawings() |
适用于论文中直接插入的位图(如实验结果截图、照片等):
import fitz # PyMuPDF
import os
def extract_embedded_images(pdf_path, output_dir):
"""提取 PDF 中嵌入的位图"""
os.makedirs(output_dir, exist_ok=True)
doc = fitz.open(pdf_path)
for page_num in range(len(doc)):
page = doc[page_num]
images = page.get_images(full=True)
for img_idx, img in enumerate(images):
xref = img[0]
base = doc.extract_image(xref)
image_bytes = base["image"]
image_ext = base["ext"]
# 过滤过小的图片(可能是图标/装饰)
if base["width"] > 100 and base["height"] > 100:
output_path = f"{output_dir}/page{page_num+1}_img{img_idx+1}.{image_ext}"
with open(output_path, "wb") as f:
f.write(image_bytes)
doc.close()
适用于论文中绑制的架构图、流程图、图表等矢量图形:
import fitz
import os
def extract_vector_figures(pdf_path, output_dir, dpi=200, min_size=100):
"""
使用 cluster_drawings() 识别矢量图形区域并截图
Args:
pdf_path: PDF 文件路径
output_dir: 输出目录
dpi: 输出分辨率(默认 200,可提高到 300 获得更清晰的图片)
min_size: 最小尺寸阈值,过滤装饰线条(默认 100pt)
"""
os.makedirs(output_dir, exist_ok=True)
doc = fitz.open(pdf_path)
figures = []
for page_num in range(len(doc)):
page = doc[page_num]
# 识别矢量图形的聚类区域
# x_tolerance/y_tolerance 控制相邻元素的合并距离
try:
drawing_rects = page.cluster_drawings(
x_tolerance=3,
y_tolerance=3
)
except Exception:
# 某些 PDF 可能不支持,跳过
continue
for idx, rect in enumerate(drawing_rects):
# 过滤过小的区域(可能是线条/装饰)
if rect.width < min_size or rect.height < min_size:
continue
# 扩展边界,避免裁切太紧
rect = rect + (-10, -10, 10, 10)
# 确保不超出页面边界
rect = rect & page.rect
# 高分辨率截图
zoom = dpi / 72
mat = fitz.Matrix(zoom, zoom)
pix = page.get_pixmap(matrix=mat, clip=rect)
output_path = f"{output_dir}/page{page_num+1}_fig{idx+1}.png"
pix.save(output_path)
figures.append({
"page": page_num + 1,
"path": output_path,
"rect": rect
})
doc.close()
return figures
当自动识别效果不理想时,可手动指定坐标:
import fitz
def crop_figure(pdf_path, page_num, rect, output_path, dpi=200):
"""
从 PDF 指定页面裁剪特定区域
Args:
pdf_path: PDF 路径
page_num: 页码(从 1 开始)
rect: (x0, y0, x1, y1) 坐标,单位为点(pt),72pt = 1英寸
output_path: 输出图片路径
dpi: 分辨率
"""
doc = fitz.open(pdf_path)
page = doc[page_num - 1]
clip = fitz.Rect(rect)
zoom = dpi / 72
mat = fitz.Matrix(zoom, zoom)
pix = page.get_pixmap(matrix=mat, clip=clip)
pix.save(output_path)
doc.close()
# 使用示例:裁剪第 2 页的某个区域
# 坐标可通过 PDF 阅读器查看,或先用方法 2 识别后微调
crop_figure(
"paper.pdf",
page_num=2,
rect=(50, 100, 550, 400), # 左上角(50,100) 到 右下角(550,400)
output_path="./images/fig1_architecture.png"
)
自动尝试多种方法,提取所有图表:
import fitz
import os
def smart_extract_figures(pdf_path, output_dir, dpi=200):
"""
智能提取论文中的所有图表
1. 先使用 cluster_drawings 识别矢量图形
2. 再提取嵌入式位图
3. 自动过滤和去重
"""
os.makedirs(output_dir, exist_ok=True)
doc = fitz.open(pdf_path)
results = {"vector": [], "embedded": []}
for page_num in range(len(doc)):
page = doc[page_num]
# 1. 提取矢量图形
try:
rects = page.cluster_drawings(x_tolerance=3, y_tolerance=3)
for idx, rect in enumerate(rects):
if rect.width > 100 and rect.height > 100:
rect = (rect + (-10, -10, 10, 10)) & page.rect
zoom = dpi / 72
pix = page.get_pixmap(matrix=fitz.Matrix(zoom, zoom), clip=rect)
path = f"{output_dir}/p{page_num+1}_vec{idx+1}.png"
pix.save(path)
results["vector"].append(path)
except:
pass
# 2. 提取嵌入式图片
for img_idx, img in enumerate(page.get_images(full=True)):
xref = img[0]
base = doc.extract_image(xref)
if base["width"] > 100 and base["height"] > 100:
path = f"{output_dir}/p{page_num+1}_img{img_idx+1}.{base['ext']}"
with open(path, "wb") as f:
f.write(base["image"])
results["embedded"].append(path)
doc.close()
print(f"提取完成: {len(results['vector'])} 个矢量图, {len(results['embedded'])} 个位图")
return results
# 使用示例
results = smart_extract_figures("paper.pdf", "./images/")
Q: 提取的图片包含多个 Figure 合在一起?
调小 x_tolerance 和 y_tolerance 参数(如 1-2),使聚类更严格。
Q: 同一个 Figure 被切成多块?
调大容差参数(如 10-20),使相邻元素合并。
Q: 某些 Figure 没有被识别?
get_images() 方法Q: 图片模糊?
提高 dpi 参数到 300 或更高。
请阅读这篇论文,生成一篇专业的阅读笔记,适合发布到技术社区。
请阅读这篇论文,重点分析:
1. HSTU 与标准 Transformer 的区别
2. Scaling Law 实验的设置和结论
3. 在工业场景的落地可行性
请对比分析这两篇论文在 XXX 问题上的不同解法。
# 图片提取
pip install pymupdf
# PDF 转图片(可选)
pip install pdf2image
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@anthropic/mcp-server-filesystem", "/path/to/papers"]
},
"notion": {
"command": "npx",
"args": ["-y", "@notionhq/notion-mcp-server"],
"env": {
"OPENAPI_MCP_HEADERS": "{\"Authorization\": \"Bearer YOUR_TOKEN\", \"Notion-Version\": \"2022-06-28\"}"
}
}
}
}