HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
karpathy
minbpe
Python2024–2024
karpathy / minbpe

minbpe

Minimal, clean code for the Byte Pair Encoding (BPE) algorithm commonly used in LLM tokenization.

2Distinct people
2Mentions
0Explicit recommenders
11KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Minimal, clean code for the Byte Pair Encoding (BPE) algorithm commonly used in LLM tokenization.

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by hour2 dated mentions

Observed mentions: 2024-02-17 07:58:00 UTC to 2024-02-18 08:15:29 UTC.

012024-02-17 07:00:00 UTC to 2024-02-17 08:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 commentsFeb 17, 07:002024-02-17 08:00:00 UTC to 2024-02-17 09:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-17 09:00:00 UTC to 2024-02-17 10:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-17 10:00:00 UTC to 2024-02-17 11:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-17 11:00:00 UTC to 2024-02-17 12:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-17 12:00:00 UTC to 2024-02-17 13:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-17 13:00:00 UTC to 2024-02-17 14:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-17 14:00:00 UTC to 2024-02-17 15:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-17 15:00:00 UTC to 2024-02-17 16:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-17 16:00:00 UTC to 2024-02-17 17:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-17 17:00:00 UTC to 2024-02-17 18:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-17 18:00:00 UTC to 2024-02-17 19:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-17 19:00:00 UTC to 2024-02-17 20:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsFeb 17, 19:002024-02-17 20:00:00 UTC to 2024-02-17 21:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-17 21:00:00 UTC to 2024-02-17 22:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-17 22:00:00 UTC to 2024-02-17 23:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-17 23:00:00 UTC to 2024-02-18 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-18 00:00:00 UTC to 2024-02-18 01:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-18 01:00:00 UTC to 2024-02-18 02:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-18 02:00:00 UTC to 2024-02-18 03:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-18 03:00:00 UTC to 2024-02-18 04:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-18 04:00:00 UTC to 2024-02-18 05:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-18 05:00:00 UTC to 2024-02-18 06:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-18 06:00:00 UTC to 2024-02-18 07:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-18 07:00:00 UTC to 2024-02-18 08:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-18 08:00:00 UTC to 2024-02-18 09:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsFeb 18, 08:00

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Feb 17, 07:002024-02-17 07:00:00 UTC2024-02-17 08:00:00 UTC110
Feb 17, 08:002024-02-17 08:00:00 UTC2024-02-17 09:00:00 UTC000
Feb 17, 09:002024-02-17 09:00:00 UTC2024-02-17 10:00:00 UTC000
Feb 17, 10:002024-02-17 10:00:00 UTC2024-02-17 11:00:00 UTC000
Feb 17, 11:002024-02-17 11:00:00 UTC2024-02-17 12:00:00 UTC000
Feb 17, 12:002024-02-17 12:00:00 UTC2024-02-17 13:00:00 UTC000
Feb 17, 13:002024-02-17 13:00:00 UTC2024-02-17 14:00:00 UTC000
Feb 17, 14:002024-02-17 14:00:00 UTC2024-02-17 15:00:00 UTC000
Feb 17, 15:002024-02-17 15:00:00 UTC2024-02-17 16:00:00 UTC000
Feb 17, 16:002024-02-17 16:00:00 UTC2024-02-17 17:00:00 UTC000
Feb 17, 17:002024-02-17 17:00:00 UTC2024-02-17 18:00:00 UTC000
Feb 17, 18:002024-02-17 18:00:00 UTC2024-02-17 19:00:00 UTC000
Feb 17, 19:002024-02-17 19:00:00 UTC2024-02-17 20:00:00 UTC000
Feb 17, 20:002024-02-17 20:00:00 UTC2024-02-17 21:00:00 UTC000
Feb 17, 21:002024-02-17 21:00:00 UTC2024-02-17 22:00:00 UTC000
Feb 17, 22:002024-02-17 22:00:00 UTC2024-02-17 23:00:00 UTC000
Feb 17, 23:002024-02-17 23:00:00 UTC2024-02-18 00:00:00 UTC000
Feb 18, 00:002024-02-18 00:00:00 UTC2024-02-18 01:00:00 UTC000
Feb 18, 01:002024-02-18 01:00:00 UTC2024-02-18 02:00:00 UTC000
Feb 18, 02:002024-02-18 02:00:00 UTC2024-02-18 03:00:00 UTC000
Feb 18, 03:002024-02-18 03:00:00 UTC2024-02-18 04:00:00 UTC000
Feb 18, 04:002024-02-18 04:00:00 UTC2024-02-18 05:00:00 UTC000
Feb 18, 05:002024-02-18 05:00:00 UTC2024-02-18 06:00:00 UTC000
Feb 18, 06:002024-02-18 06:00:00 UTC2024-02-18 07:00:00 UTC000
Feb 18, 07:002024-02-18 07:00:00 UTC2024-02-18 08:00:00 UTC000
Feb 18, 08:002024-02-18 08:00:00 UTC2024-02-18 09:00:00 UTC101

What Hacker News says

2 sources
Hehe. https://github.com/karpathy/minbpe/blob/master/minbpe/base.p... This code will incorrectly count pairs in [1,1,1] as two pairs of (1,1), despite there is only one, if you consider what merge function does. ;) This can be seen in real world scenarios, for example, when there are many spaces. My attempt to implement BPE has the same flaw and the fix appear to be very complex. But, as I looked at stats, it just makes such pairs to appear as top ones a couple of runs earlier, so it appears as a benign flaw. But, it's interesting that this is not mentioned in the code.
In Code for the Byte Pair Encoding algorithm, commonly used in LLM tokenization

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.