Show HN: Sort lines semantically using llm-sort
4 comments
·February 11, 2025adamgordonbell
Have you tried reading the probability of X being the token returned? then you will probably be get better answers and not need to compare every 2.
Log probabilities of output tokens indicate the likelihood of each token occurring given the context.
cratermoon
cat spelling.txt | llm sort -q "how many times does the letter 'r' appear in the word 'strawberry'?"
cat geology.txt | llm sort -q "which kind of rock is the best to eat, according to Berkeley geologists?"
cat law-library.txt | llm sort -q "what legal precedents are best for my lawsuit vs Colombian airline Avianca?"
cat adhesives.txt | llm sort -q "what glue is best for holding the cheese on my pizza?"
MPSimmons
O(n^f***)
gntousakis
Great work!
This is a small plugin I made for Simon Willison's llm utility.
You can do things like:
cat names.txt | llm sort -q "Which one of these names is best for a pet seagull?"
cat books.txt | llm sort -q "Which book is more related to basic vs. advanced CS topics?"
I see a lot of potential marrying LLMs with classic UNIX interfaces.