Measure Zero


  • About

  • Quotes

  • Notes

  • Sitemap

  • Search

用 Pydantic 自动生成 LLM Tool Schema

2025-09-14 | ~ | Machine Learning

定义 tool 参数后, 不引入其他库, 仅用 Pydantic 自动生成符合 OpenAI 规范的 Tool Schema. 想法很简单, 把 Pydantic 的 model_json_schema 生成的 JSON Schema 处理成 OpenAI 规范即可.

好处是 (1) 不用引入或依赖其他乱七八糟的库; (2) 不用手动额外维护一套工具描述; (3) 能利用 Pydantic 的一些功能, 从 JSON string load 之后自动校验参数, 自动转换类型等.

Read more »

难倒各路大模型的两道简单 SQLite 问题

2025-05-05 | ~ | Tech

问题描述以及示例 prompt 如下


你是 SQLite 专家, 请完成下面两个问题.

  1. 用 SQLite 写一个 query, 根据 “now” 获得当地时间今日零点的 unix 时间戳. 注: “当地” 指执行 SQL 的机器的系统时区, “今日” 指当地日期的今日.

例: 若 now 为 ‘2025-05-05 04:00:00+08:00’, 则返回 ‘2025-05-05 00:00:00+08:00’. (假设当地时区为 UTC+8)

  1. 用 SQLite 写一个 query, 根据 “now” 获得上周的周一的日期. 假设周一为一周的开始, 全程只在 UTC 时间考虑问题 (不用考虑时区).

例: 若 now 为 ‘2025-05-05’ 周一, 则返回 ‘2025-04-28’. 若 now 为 ‘2025-05-04’ 周日, 则返回 ‘2025-04-21’.

Read more »

LightRAG 源码简要分享

2025-01-21 | ~ | Machine Learning

Guo, Z., Xia, L., Yu, Y., Ao, T., & Huang, C. (2024). Lightrag: Simple and fast retrieval-augmented generation.

大体流程:

  • 用 LLM 提取 chunks 中的实体和关系, 并存成一个图
  • 用 LLM 从 query 中提取关键词, 根据关键词召回实体或关系, 再找到最相关的 chunks, 最后把所有东西都拼起来给 LLM 输出答案
Read more »

ModernBERT

2024-12-24 | ~ | Machine Learning
  • Warner, B., Chaffin, A., Clavié, B., Weller, O., Hallström, O., Taghadouini, S., … & Poli, I. (2024). Smarter, Better, Faster, Longer: A Modern Bidirectional Encoder for Fast, Memory Efficient, and Long Context Finetuning and Inference. arXiv preprint arXiv:2412.13663.
  • 2024-12-19 Hugging Face Finally, a Replacement for BERT

如同字面意思, 更现代的 BERT, 更快更强而且 context length 拓展到 8k tokens, 也是首个在训练数据中加入大量代码数据的 encoder-only 模型. BERT 系模型对比 LLM 的优势是快, 便宜, 而且很多任务适用 encoder-only 结构.

Read more »

LoRA 变体

2024-08-18 | ~ | Machine Learning
Read more »

读文章: Understanding Pins through keyword extraction

2024-01-10 | ~ | Machine Learning

挺久之前读的, 补个笔记. 传统机器学习. 从帖子的多个文本来源抽取候选标签, 然后用分类模型判断标签是否与帖子相关. 没有用到图片信息 (除了从图中抽取文字).

  • 2019-08 Understanding Pins through keyword extraction
Read more »

LLM-based Text2SQL

2023-12-25 | ~ | Machine Learning

Gao, D., Wang, H., Li, Y., Sun, X., Qian, Y., Ding, B., & Zhou, J. (2023). Text-to-sql empowered by large language models: A benchmark evaluation. arXiv preprint arXiv:2308.15363.

个人总结: 一篇 LLM 在 Text2SQL 数据集上的 prompt engineering 的实验报告. 在文中评测的两个数据集中效果是开源方案中最好的. 提出的 prompt 方案 DAIL-SQL 融合了现有的几种 RAG 方法.

Read more »

A Guide for Customizing Difficulty in Tactics Ogre One Vision Mod

2023-12-08 | ~ 2025-06-01 | Games

This guide will walk you through using cheat codes to tailor—and particularly increase—the challenge level in Tactics Ogre: Let Us Cling Together (PSP), with a focus on the One Vision mod.

Read more »

读论文: Direct Fact Retrieval from Knowledge Graphs without Entity Linking

2023-12-04 | ~ | Machine Learning

Baek, J., Aji, A. F., Lehmann, J., & Hwang, S. J. (2023). Direct Fact Retrieval from Knowledge Graphs without Entity Linking. arXiv preprint arXiv:2305.12416.

简单粗暴的召回 + 排序. 流程是标准的, 粗暴点 (“创新点”) 在于直接输入句子与知识库中的东西算相似度. 两句话讲完.

Read more »

膝盖和肩膀如何工作

2023-12-03 | ~ | Miscellanea

参考 How does the knee work? 与 How does the shoulder work?, 非常简略. 更多简短补充可以看视频 膝关节结构讲解 与 肩关节解剖结构讲解.

Read more »
1 2 … 18
Shiina

Shiina

知乎 豆瓣 bangumi Instagram Weibo
Creative Commons
RSS
© 2019 - 2025   Shiina   CC BY-NC-ND 4.0
RSS  
Powered by Jekyll
 
Theme NexT.Mist