-38
you are viewing a single comment's thread
view the rest of the comments
[-] MagicShel@lemmy.zip 9 points 1 week ago* (last edited 1 week ago)

Naturally, the LLM can generate interpretations and probabilities which are not correct. Yet, we believe that an LLM is a good-enough measure of semantic ambiguity for our needs.

You’re asking an LLM to invent a probability distribution over meanings. Embedding models are explicitly trained to represent semantic similarity geometrically. Why not use the right tool for the job over "slop"?

  1. Download you an embedding model — you can run it on garbage, or pay for an API if you want.
  2. Embed the identifier
  3. Embed the symbol’s implementation summary (or docstring)
  4. cosine(name_embedding, description_embedding)
  5. Have LLM suggest alternatives and repeat
  6. Rank names by semantic similarity.

ETA:

I present: https://gitlab.com/MagickShel/namer

It doesn't generate the list of names to test, though. I leave that to the imagination of the user.

ETAA:

There is a class of naming it doesn't work great on. I probably overstepped and was a bit of an ass. This just gave me the inspiration to do basically the thing you did here, the way I have told myself for months it should be done.

Also, there is a class of naming - jargon and acronyms - where your approach works better. I still prefer something more deterministic, but credit where credit is due.

[-] sebastiancarlos@lemmy.sdf.org 2 points 1 week ago* (last edited 1 week ago)

Hey, absolute props for replying to my code by making a counter-code of your own!

I don't have the time to look into this right now, but wanted to say that this is the best I could hope of posting my random projects here: Having someone else tell you what they would do instead.

And for context, this was a weekend experiment. I wanted to try building "agentic stuff," and exploring the not-so-promising intersection of information theory, LLMs, and code quality.

Will edit later after I read yours.

[-] MagicShel@lemmy.zip 2 points 1 week ago* (last edited 1 week ago)

This is how RAG pipelines work. You chunk up text and then embed it, which gives you a vector representation of the text. You store that in a database keys in the vector Then when you want to inject relevant information for a prompt, you embed the prompt to get a vector, and then dump the a handful of most similar chunks into context to provide additional information.

So this semantic similarity question has been in my mind for a while to answer the question of what names would be the most "intuitive" for an LLM.

Does it work? shrug I guess we'll find out.

this post was submitted on 15 Aug 2026
-38 points (13.5% liked)

Programming

28283 readers
121 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 3 years ago
MODERATORS