implement-paper
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseImplement Paper
将研究论文转化为交互式marimo笔记本
Turn a research paper into an interactive marimo notebook. For general marimo notebook conventions (cell structure, PEP 723 metadata, output rendering, , variable naming, etc.), refer to the skill.
marimo checkmarimo-notebook将研究论文转化为交互式marimo笔记本。关于marimo笔记本的通用规范(单元格结构、PEP 723元数据、输出渲染、、变量命名等),请参考技能文档。
marimo checkmarimo-notebookStep 1: Understand what the user wants
步骤1:了解用户需求
Before fetching or reading anything, have a short conversation to scope the work. Ask the user:
- Which part of the paper interests you most? A paper may have multiple contributions — the user likely cares about one or two. Don't implement the whole thing.
- What's the goal? Are they trying to understand the method, reproduce a result, adapt it to their own data, or teach it to someone else? This changes the notebook's tone and depth.
- Do they want to use a specific dataset? If it's relevant, ask. Otherwise, suggest simulating data.
- Does this require PyTorch? Some papers need it, many don't. Ask if unclear — it's a heavy dependency.
- What's their background? The paper aims to fill a knowledge gap — gauge what the user already knows so the notebook can meet them where they are. Skip basics they're familiar with, explain prerequisites they're not.
Only move on once you have a clear picture of what to build.
在获取或阅读任何内容之前,先通过简短沟通明确工作范围。请询问用户:
- 你最关注论文的哪一部分? 一篇论文可能有多个贡献点——用户通常只关心其中一两个。无需实现整篇论文的内容。
- 你的目标是什么? 是想要理解论文中的方法、复现实验结果、将方法适配到自有数据,还是用于教学?这会影响笔记本的风格和深度。
- 是否需要使用特定数据集? 如果相关,请询问用户。否则,建议模拟数据。
- 是否需要依赖PyTorch? 部分论文需要PyTorch,但很多不需要。如果不确定请询问——这是一个较重的依赖项。
- 你的知识背景如何? 论文旨在填补知识空白——评估用户已掌握的知识,让笔记本内容贴合其水平。跳过用户熟悉的基础知识,解释其不了解的前置内容。
只有在明确要构建的内容后,再进入下一步。
Step 2: Fetch the paper
步骤2:获取论文
See references/fetching-papers.md for how to retrieve paper content via alphaxiv.org. This avoids reading raw PDFs and gives you structured markdown.
请参考references/fetching-papers.md了解如何通过alphaxiv.org获取论文内容。这种方式无需读取原始PDF,能为你提供结构化的markdown格式内容。
Step 3: Plan the notebook
步骤3:规划笔记本
After reading the paper, outline the notebook structure for the user before writing code.
Keep the notebook as small as possible. Sometimes the idea is best conveyed with just a single interactive widget — if you need a custom one, consider the skill. Other times you need a full training loop — if so, consider using the skill for heavy computation. The goal is the minimum amount of code needed to get the idea across.
anywidgetmarimo-batchA typical arc:
| Section | Purpose | Typical elements |
|---|---|---|
| Title & context | Orient the reader | |
| Background | Set up prerequisites | Markdown + equations |
| Method | Core algorithm step-by-step | Code + markdown interleaved |
| Experiments | Reproduce key results | Interactive widgets + plots |
| Conclusion | Summarize takeaways | |
Not every notebook needs all sections. Share the outline with the user and adjust before writing code.
阅读论文后,先向用户展示笔记本的结构大纲,再开始编写代码。
尽量简化笔记本内容。 有时只需一个交互式组件就能传达核心思想——如果需要自定义组件,可以考虑使用技能。如果需要完整的训练循环,可以使用技能处理繁重的计算任务。目标是用最少的代码传达核心思想。
anywidgetmarimo-batch典型的结构流程:
| 章节 | 目的 | 典型内容 |
|---|---|---|
| 标题与背景介绍 | 引导读者了解主题 | 包含论文标题、作者、链接的 |
| 背景知识 | 介绍前置必备知识 | Markdown文本 + 公式 |
| 方法实现 | 逐步讲解核心算法 | 代码与Markdown交替呈现 |
| 实验复现 | 复现关键实验结果 | 交互式组件 + 图表 |
| 结论总结 | 总结核心要点 | |
并非所有笔记本都需要包含所有章节。先与用户分享大纲并调整后,再开始编写代码。
Step 4: Build the notebook
步骤4:构建笔记本
Create the marimo notebook following the skill conventions.
marimo-notebookKey guidelines:
- Never assume the dataset. Use whatever the user specified in Step 1. If they didn't specify one, simulate data.
- Make it self-contained. A reader should understand the notebook without reading the full paper.
- Use KaTeX for equations. Render key equations with so the notebook mirrors the paper's notation. Keep notation consistent with the paper.
mo.md(r"""$...$""") - Add interactivity where it aids understanding. Sliders for hyperparameters, dropdowns for dataset variants, or toggles for ablations help readers build intuition.
- Show, don't just tell. Prefer a plot or table over a paragraph of explanation.
- Name variables to match the paper's notation where practical (e.g., ,
alpha,X), and add comments mapping them to equation numbers.W
遵循技能的规范创建marimo笔记本。
marimo-notebook核心准则:
- 不要默认使用特定数据集。 使用用户在步骤1中指定的数据集。如果用户未指定,则模拟数据。
- 确保内容自洽。 读者无需阅读整篇论文,就能理解笔记本的内容。
- 使用KaTeX渲染公式。 用渲染关键公式,让笔记本与论文的符号保持一致。
mo.md(r"""$...$""") - 在有助于理解的地方添加交互性。 超参数滑块、数据集变体下拉菜单、或消融实验切换器能帮助读者建立直观认知。
- 可视化优先,文字为辅。 优先使用图表或表格,而非大段文字解释。
- 变量命名尽量匹配论文符号(例如、
alpha、X),并添加注释说明其对应论文中的公式编号。W
Tips
小贴士
- Don't reproduce the entire paper. Focus on what the user asked about in Step 1.
- Iterate visually. Build up figures incrementally (e.g., show data → show model fit → show residuals) rather than dumping everything into one plot.
- If the paper uses heavy notation, include a small "notation reference" cell with a markdown table mapping symbols to descriptions.
- 无需复现整篇论文。 专注于用户在步骤1中提出的需求。
- 逐步构建可视化内容。 分阶段生成图表(例如先展示数据→再展示模型拟合结果→最后展示残差),而非将所有内容一次性放入一个图表中。
- 如果论文使用复杂符号,添加一个小型的“符号参考”单元格,用Markdown表格列出符号及其含义。