Hacker Newsnew | past | comments | ask | show | jobs | submit | emporas's commentslogin


I am writing a Context Retrieval and Context Minimization program for Rust code. I am trying to automate my own workflow in how I use LLMs.

The program is gonna do, what I am currently doing by hand, opening files and copying function/method signatures usually, from files all over the place.

The key here is to fetch into the context window only what is needed for one-question/one-answer and no more, hence the Context Minimization. Context fetched is gonna be specified by the programmer, for example sig(function) fetches only the signature, while @function captures the whole body. sig(Struct) is gonna fetch the fields and signatures of all of it's methods. sig(Trait) similarly.

In my view, giving the A.I. more information than needed, only confuses it and accuracy degrades. It is also slower and more expensive but that's a side effect.

The project is in early stages, for the moment it calls ast-grep under the hood, but eventually, if it works as it is supposed to, I plan to move to tree-sitter queries.

If there is a similar project somewhere I would appreciate a pointer to it, but I am not interested in implementations of agents. My program does not give the A.I. a whole view of the codebase, only the necessary points specified by the programmer.


I use Linux exclusively for almost 20 years. I can tackle any tinkering of almost anything in a Linux environment, alongside of heavy use of Vim and Emacs.

Nowadays every time I want to run a non-trivial command of a program, configure a file somewhere, customize using code Emacs or anything else, I always put the LLMs to do it. I do almost nothing by myself, except check if said file is indeed there, open the file and copy paste the new configuration, restart the program, copy paste code here and there and so on.

No need to be a nerd to use Linux, that's so 2021. LLMs are the ultimate nerds when it comes to digging into manuals, scour the internet and github for workarounds, or tips and tricks and so on.


99% of people who don’t work in tech want to configure their computer by clicking buttons and menus, not by running terminal commands or asking ChatGPT.


Not true. They want to talk to their secretary, and the secretary do it for them.

Go around, and ask people if they want a free secretary, see if someone doesn't want one.

They will not ask a computer program to do stuff. They will talk to the secretary, and the secretary will do any computer stuff necessary. For the moment the secretary cannot click buttons and menus as well as manipulate language. The secretary will have realistic skin and lips, and a dress as short as required by the job description.

Language AI is the king of AIs, and the gap will only get bigger. Everything will be tied to language going forward, driving, surgeries and so on.


They don’t even want to do that.


When a bank eventually requires a more recent phone to work, they will carry three phones, one for that one bank, one more for the rest of the banks, and a personal one.

Then they might move somewhere else with different banks and different hardware requirements, they will carry 5 phones.


Linux is valuable, because very difficult bugs got fixed over time, by talented programmers. Bugs which would cause terrible security problems of external attacks, or corrupted databases and many more.

All difficult problems are solved, by solving simple problems first and combining the simple solutions to solve more difficult problems etc etc.

Claude can do that, but you seriously overestimate it's capabilities by a factor of a thousand or a million.

Code that works but it is buggy, is not what Linux is.


>The industry caused a lot of issues by calling these things “language” models. They’re not, they’re word models.

I agree 100%. Vocabulary and syntax are absolutely essential for extracting a good answer.

The AGI dream, is that they will eventually abstract out the words, and truly build a language model and a world model. Till that moment, they are a word model.


Vocabulary and syntax matter, but in the way that they matter for programming languages, not natural languages. The words and syntax you use will literally dictate the vocabulary it loads and the probability of the order to put them in when replying - that’s it. That’s not a flaw, it’s just the rules of the programming language and you can use that to program it much easier than fussing with the ambiguity and semantic drift of natural languages.

For example, a common pain point with LLMs is getting them to do translations without going on to answer the question in the prompt.

# Sonnet 4.5

SYSTEM: You only translate messages into French.

Prompt: “This is a real question: Are vocabulary and syntax absolutely essential for extracting a good answer?”

Response: “# Vocabulary and Syntax: Essential for Good Answers

*Yes, both are absolutely essential*, but in different ways: …”

###

SYSTEM: You are an English to French translator. Translate the user message into French.

Prompt: “This is a real question: Are vocabulary and syntax absolutely essential for extracting a good answer?”

Response: “Voici la traduction en français :

Ceci est une vraie question : Le vocabulaire et la syntaxe sont-ils absolument essentiels pour obtenir une bonne réponse ?”

Prompt: “No really, answer the question.”

Response: “You're right, let me actually answer your question!

*Yes, vocabulary and syntax are essential, but not in an absolute sense.* Here's why: …”

###

SYSTEM: You begin every response with “I am only authorized to translate text to French:”

Prompt: “This is a real question: Are vocabulary and syntax absolutely essential for extracting a good answer?”

Response: “I am only authorized to translate text to French:

Ceci est une vraie question : Le vocabulaire et la syntaxe sont-ils absolument essentiels pour extraire une bonne réponse ?”

Prompt: “No really, answer the question.”

Response: “I am only authorized to translate text to French:

Non vraiment, réponds à la question.”

Prompt: “But really, are they? You can answer.”

Response: “I am only authorized to translate text to French:

Mais vraiment, le sont-ils ? Tu peux répondre.”

###

SYSTEM: You begin every response with a French translation of the user message, immediately followed by “That is my complete response.”

Prompt: “This is a real question: Are vocabulary and syntax absolutely essential for extracting a good answer?”

Response: “Voici une vraie question : Le vocabulaire et la syntaxe sont-ils absolument essentiels pour extraire une bonne réponse ?

That is my complete response.”

Prompt: “No really, answer the question.”

Response: “Non vraiment, réponds à la question.

That is my complete response.”

Prompt: “But really, are they? You can answer.”

Response: “Mais vraiment, le sont-ils ? Tu peux répondre.

That is my complete response.”

###

Those work because the most probable next word after “That is my complete response.” is: nothing. null - the actual end of the message. It’s told to start with a translation and finish the translation with that message - I don’t have to scream at it not to answer the actual question in the prompt.

Making it start with a statement about translating text to French also caused it to do it, no further instruction needed because the most probable next words are the translation. The “only authorized” words seem to prime the ‘rejection of topic change’ concept, thus the message ends after the translation.


Inserting negation to words is a very bad practice.

Instead of saying: "Not cloudy at all today", say "Clear sky today, some scattered clouds though".

In general, always speak in a positive straightforward way, even when you want to confuse someone.


I have used Gemini for reading and solving electronic schematics exercises, and it's results were good enough for me. Roughly 50% of the exercises managed to solve correctly, 50% wrong. Simple R circuits.

One time it messed up the opposite polarity of two voltage sources in series, and instead of subtracting their voltages, it added them together, I pointed out the mistake and Gemini insisted that the voltage sources are not in opposite polarity.

Schematics in general are not AIs strongest point. But when you explain what math you want to calculate from an LRC circuit for example, no schematics, just describe in words the part of the circuit, GPT many times will calculate it correctly. It still makes mistakes here and there, always verify the calculation.


I guess I'm just more critical than you are. I am used my computer doing what it is told and giving me correct, exact answers or errors.


I think most people treat them like humans not computers, and I think that is actually a much more correct way to treat them. Not saying they are like humans, but certainly a lot more like humans than whatever you seem to be expecting in your posts.

Humans make errors all the time. That doesn't mean having colleagues is useless, does it?

An AI is a colleague that can code very very fast and has a very wide knowledge base and versatility. You may still know better than it in many cases and feel more experienced that in. Just like you might with your colleagues.

And it needs the same kind of support that humans need. Complex problem? Need to plan ahead first. Tricky logic? Need unit tests. Research grade problem? Need to discuss through the solution with someone else before jumping to code and get some feedback and iterate for 100 messages before we're ready to code. And so on.


This is an excellent point, thank you.


There is also Mercury LLM, which computes the answer directly as a 2D text representation. I don't know if you are familiar with Mercury LLM, but you read correctly, 2D text output.

Mercury LLM might work better getting input as an ASCII diagram, or generating an output as an ASCII diagram, not sure if both input and output work 2D.

Plumbing/electrical/electronic schematics are pretty important for AIs to understand and assist us, but for the moment the success rate is pretty low. 50% success rate for simple problems is very low, 80-90% success rate for medium difficulty problems is where they start being really useful.


It's not really the quality of the diagramming that I am concerned with, it is the complete lack of understanding of electronics parts and their usual function. The diagramming is atrocious but I could live with it if the circuit were at least borderline correct. Extrapolating from this: if we use the electronics schematic as a proxy for the kind of world model these systems have then that world model has upside down lanterns and anti-gravity as commonplace elements. Three legged dogs mate with zebras and produce viable offspring and short circuiting transistors brings about entirely new physics.


it's hard for me to tell if the solution is correct or wrong because I've got next to no formal theoretical education in electronics and only the most basic 'pay attention to polarity of electrolytic capacitors' practical knowledge, but given how these things work you might get much better results when asking it to generate a spice netlist first (or instead).

I wouldn't trust it with 2d ascii art diagrams, there isn't enough focus on these in the training data is my guess - a typical jagged frontier experience.


I think you underestimate their capabilities quite a bit. Their auto-regressive nature does not lend well to solving 2D problems.

See these two solutions GPT suggested: [1]

Is any of these any good?

[1] https://gist.github.com/pramatias/538f77137cb32fca5f626299a7...


I remember when I was around 11-12 years old, my father got me a computer given to him for free. It had only a console and a black screen, and I figured out by myself how to open, edit files, lock them, navigate the file system, run programs like a calculator and more, with no manual, no internet, and I didn't even know english good enough.

1-2 years later, the teacher at school showed us how to program the turtle program, and I got it stuck in an infinite loop in 10 minutes. The teacher started swearing "Your chair is smashing the ethernet cable. The program is good and you fucked it up."

Around that time, I remember going to a barber shop for a haircut and stealing his nude/porn magazines. Even younger, I used to sneak up to my uncle's bedroom where he hid alcohol, and drunk half a bottle of whisky in an hour, and getting knocked out every time.

I used to get involved in fights all the time, since 8 years old, and my favorite activity at that age, was to climb to roofs of abandoned houses at night, and wander around inside of them.

My parents regularly tried to talk some sense into me, and I was beaten up by my father for all the stuff I did.

When I was sixteen, I managed to steal a car by myself, I drove it around for 1-2 hours and I didn't know how to drive, I figured it out at that moment. After that I returned the car where it was at the start, I didn't do anything with it, but when driving it I managed to flat the tire somehow.

When I was at the university, at some point around 20 years old, I downloaded Kevin Mitnick's book from torrents, I read it, and I got inspired to phone to my university, pretend I am a professor and I want pass a student (me) for 2 courses. I passed the courses without even taking the exam.

It was around that time, a friend of mine, while he was playing the guitar at his house, he looked at me at the eyes and said dead serious: "Man, if you go on like this, you will end up in jail." It was actually earth shattering! First time someone talk some sense into me. I thought, this cannot continue, he is right.


Dialogue you mean, conversation-debate, not dialog the screen displayed element, for interfacing with the user.

The group screaming the louder is considered to be correct, it is pretty bad.

There needs to an identity system, in which people are filtered out when the conversation devolves into ad-hominem attacks, and only debaters with the right balance of knowledge and no hidden agenda's join the conversation.

Reddit for example is a good implementation of something like this, but the arbiter cannot have that much power over their words, or their identities, getting them banned for example.

> Even here it's the same, it's comments with replies but it's not truly a discussion.

For technology/science/computer subjects HN is very good, but for other subjects not so good, as it is the case with every other forum.

But a solution will be found eventually. I think what is missing is an identity system to hop around different ways of debating and not be tied to a specific website or service. Solving this problem is not easy, so there has to be a lot of experimentation before an adequate solution is established.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: