Better HN
topnewbestaskshowjobs
Log inSign up

matthewolfe

133 karma · joined Feb 27, 2021 (5y ago) · 40 submissions

Submissions

1.

Sessiongrep: Local-first memory layer for CLI agents(github.com ↗)

2 points · by matthewolfe · 3mo ago · discuss

2.

Timeline of Computer History(computerhistory.org ↗)

3 points · by matthewolfe · 6mo ago · 1 comment

comment 1y ago · link · parent

What exactly doesn't "just work" anymore?

4.

Hammock Driven Development – Rich Hickey [video](youtube.com ↗)

3 points · by matthewolfe · 1y ago · discuss

5.

LLM-Generated Rules Engines for LLM Explainability(brain.co ↗)

2 points · by matthewolfe · 1y ago · discuss

6.

Wormhole for Perplexity Comet(blog.gingerbeardman.com ↗)

3 points · by matthewolfe · 1y ago · 1 comment

7.

Assign Tickets to Claude Code(twitter.com ↗)

1 points · by matthewolfe · 1y ago · discuss

8.

Richard Feynman: What I cannot create, I do not understand(freshspectrum.com ↗)

1 points · by matthewolfe · 1y ago · discuss

9.

The Factorio Mindset(thediff.co ↗)

2 points · by matthewolfe · 1y ago · discuss

comment 1y ago · link · parent

I believe SchemeFlow [0] is working on solving some of these problem, particularly with the insane reporting requirements. But of course, that still leaves the unions...

[0] https://www.schemeflow.com/

comment 1y ago · link · parent

For argument's sake, suppose we live in a world where many high-quality models can be run on-device. Is there any concern from companies/model developers about exposing their proprietary weights to the end user? It's generally not difficult to intercept traffic (weights) sent to and app, or just reverse the app itself.

comment 1y ago · link · parent

To echo the other replies, the tokenizer is definitely not the bottleneck. It just happens to be the first step in inference, so it's what I did first.

comment 1y ago · link · parent

haha, I thought about it.

comment 1y ago · link · parent

Fair chance I'm remembering it wrong :D

comment 1y ago · link · parent

Alright, 0.1.1 should now be a true drop-in replacement. I'll write up some examples soon.

comment 1y ago · link · parent

Should be the same. Both use Byte-Pair Encoding (BPE) as underlying algo.

comment 1y ago · link · parent

Ah good catch. Updating this right now.

comment 1y ago · link · parent

Modal's GPU glossary is a good overview about how GPUs work [0]. Karpathy's LLM overview is a good high level overview on LLMs [1]. 3b1b's video (and subsequent videos) on transformers was excellent at helping me understand the math at a high level [2]. This matrix multiplication optimization worklog helped me understand writing better CUDA (not for beginner intro though) [3].

During this process I also asked ChatGPT a lot of questions.

I'm definitely open to suggestions about "how to learn" with all the new tools we have. I felt this has not been straightforward to figure out.

[0] https://modal.com/gpu-glossary

[1] https://www.youtube.com/watch?v=7xTGNNLPyMI

[2] https://www.youtube.com/watch?v=wjZofJX0v4M

[3] https://siboehm.com/articles/22/CUDA-MMM

comment 1y ago · link · parent

I'm working on incremental re-tokenizing next. Then I'll run some benchmarks against this crate too.

comment 1y ago · link · parent

Agreed. A former mentor of mine told me a nice way of viewing software development:

1. Make it work. 2. Make it fast. 3. Make it pretty.

Transformers & LLMs have been developed to a point where they work quite well. I feel as though we're at a stage where most substantial progress is being made on the performance side.

comment 1y ago · link · parent

Cool!

I've reached out to the guy who maintains Tiktoken to talk about this.

comment 1y ago · link · parent

A lot of model-specific tokenizers have reference implementations ([0], [1]). Underlying them is a core algorithm like SentencePiece or Byte-pair encoding (BPE). Tiktoken and TokenDagger are BPE implementations. The wrapping "tokenizer" mostly deals with the quirks of the vocabulary and handling special tokens.

For this project, I think there is value in building some of these model-specific quirks into the library. Could see some minor performance gains and generally make it easier to integrate with. It's probably not too much work to keep up with newer models. Tokenizers change much less frequently.

[0] https://github.com/meta-llama/llama-models/blob/01dc8ce46fec...

[1] https://github.com/mistralai/mistral-common/tree/main/src/mi...

comment 1y ago · link · parent

I probably will. Was hesitant initially, because adding PCRE2 as a dependency might cause issues to existing projects. I believe this was discussed briefly in a closed PR with other performance improvements.

comment 1y ago · link · parent

The output should be identical, assuming no bugs.

The Tiktoken implementation takes a collection of all special tokens upon initialization and compiles them into a regex by joining them with `|` [0]. Then the actual encoding process checks for matches on this expression.

Models like Llama 4 define a list of 1,135 special tokens. Notably, 1,115 of those are "reserved" special tokens! So this yields a huge regexp of special tokens that shouldn't be considered at all.

TokenDagger does not do this. Instead, simple string matching is used. This works because we don't need to consider the entire special vocabulary every time. The caller of `encode` must explicitly define which special tokens should be considered [1]. So it's faster to check against the much smaller list we _know_ is being used.

[0] https://github.com/openai/tiktoken/blob/main/src/lib.rs#L476

[1] https://github.com/openai/tiktoken/blob/main/tiktoken/core.p...

comment 1y ago · link · parent

Thanks, I clarified it.

comment 1y ago · link · parent

Agreed. I figured nobody would use it otherwise.

27.

Show HN: TokenDagger – A tokenizer faster than OpenAI's Tiktoken(github.com ↗)

281 points · by matthewolfe · 1y ago · 73 comments

comment 1y ago · link · parent

I'm working on TokenDagger [0] a high performance implementation of OpenAI's Tiktoken. My benchmarks are showing 2-3x higher throughput, as well as ~4x faster tokenization for code samples on a single thread.

[0] https://github.com/M4THYOU/TokenDagger

29.

From Punched Cards to Flat Screens – A Technical Autobiography(drive.google.com ↗)

1 points · by matthewolfe · 1y ago · discuss

30.

Idea to Revenue in 4 Days(sigurg.com ↗)

1 points · by matthewolfe · 1y ago · discuss

12