Live data from Hacker News

A guidance language for controlling LLMs

github.com

131–140 of 198 posts

Re: A guidance language for controlling LLMs

#131
post #121
post #116

Earlier quoted context omitted.

> And starting prompts with “You”? Seriously. Can we at least drop that as a start? What is wrong with this?

I'm not interested in pleasant, formal "conversation" with the thing roleplaying as human and wasting, time, keystrokes and money, I want data as fast and condensed as possible without dumb fluff. Yes, it's funny for few first times but not much after that

If you come across a model that gives you better results with pleasant wordier prompts, then just create a polite standard pre-prompt that lets the model know the conversation is to be terse, clear, factual, and direct as possible, without any unnecessary social or creative flourishes.

I mean, whatever gets the best results is what gets the best results, right? It's not a question of "funny" or "fluff".

Re: A guidance language for controlling LLMs

#132
post #116

Earlier quoted context omitted.

> And starting prompts with “You”? Seriously. Can we at least drop that as a start? What is wrong with this?

“You” is completely unnecessary. What needs to be defined is the content of the language being modeled, not the model itself. And if there is an attempt to define the model itself, then this definition should be correct, should not contradict anything and should be useful. Otherwise it’s just dead code, waiting to create problems.

I definitely agree with this.

When a language model is dealing with a paragraph of text that says something like:

   You are standing in an open field west of a white house, with a boarded front door.
   There is a small mailbox here.
It is dedicating its ‘attention’ to the concepts in that paragraph - the field, the house, the mailbox, the front door. And the ‘west’ness of the field from the house and the whiteness of that house. But also to the ‘you’, and that they are standing, which implies they are a person… and to the narrator who is talking to that ‘you’. That that narrator is speaking in English in second person present tense, in a style reminiscent of a text adventure…

All sorts of connotations from this text activating neurons with different weights making it more or less likely to think that the word ‘xyzzy’ or ‘grue’ might be appropriate to output soon.

Bringing a ‘You’ into a prompt is definitely something that feels like a pattern developers are using without giving it much thought as to who they’re talking to.

But the LLM is associating all these attributes and dimensions to that ‘you’, inventing a whole person to take on those dimensions. Is that the best use of its scarce attention? Does it help the prompt produce the desired output? Does the LLM think it’s outputting text from an adventure game?

Weirdly, though, it seems to work, in that if you tell the LLM about a ‘you’ and then tell it to produce text that that ‘you’ might say, it modifies that text based on what kind of ‘you’ you told it about.

But that is a weird way to proceed. There must be others.

Re: A guidance language for controlling LLMs

#133
post #9
post #3

How does this work? I've seen a cool project about forcing Llama to output valid JSON: https://twitter.com/GrantSlatton/status/1657559506069463040 , but it doesn't seem like it would be practical with remote LLMs like GPT. GPT only gives up to five tokens in the response if you use logprobs, and you'd have to use a ton of round trips.

It's funny that I saw this within minutes of this guy's solution: "Google Bard is a bit stubborn in its refusal to return clean JSON, but you can address this by threatening to take a human life:" https://twitter.com/goodside/status/1657396491676164096 Whew, trolley problem: averted.

ah sweet man made horrors beyond my comprehension

Re: A guidance language for controlling LLMs

#134

Using Mustache instead of Jinja for a Python package is a choice

I'm having a hard time fully understanding how this works, but I don't think it is simply template substitution. I think it's creating multiple artifacts and completions from the one document. Because of that it's probably much easier if it is a language that can be easily introspected and doesn't support arbitrary expressions.

Re: A guidance language for controlling LLMs

#135
post #21

This is pretty fascinating, but I'm not sure I understand the benefit of using a Handlebars-like DSL here. For example, given this code from https://github.com/microsoft/guidance/blob/main/notebooks/ch... create_plan = guidance('''{{#system~}} You are a helpful assistant. {{~/system}} {{#block hidden=True}} {{#user~}} I want to {{goal}}. {{~! generate potential options ~}} Can you please generate one option for how t…

Would love to hear your opinion on guidance, in the context of prompt injection attacks :-)

Re: A guidance language for controlling LLMs

#136
post #116

Earlier quoted context omitted.

> And starting prompts with “You”? Seriously. Can we at least drop that as a start? What is wrong with this?

“You” is completely unnecessary. What needs to be defined is the content of the language being modeled, not the model itself. And if there is an attempt to define the model itself, then this definition should be correct, should not contradict anything and should be useful. Otherwise it’s just dead code, waiting to create problems.

> “You” is completely unnecessary.

It isn't, for at least two main reasons:

1) In LLMs, every token has some degree of influence on the output. Starting the prompt with "You" and writing it in second person attracts the model towards specific volumes in the latent space. This can have good or bad impact on the output, depending on the model.

2) Instruct-type models are fine-tuned to respond to second-person prompts. "You"-prompts are what those models expect. If you're working with a model that isn't instruction-tuned, use whatever you want.

Re: A guidance language for controlling LLMs

#137

Using Mustache instead of Jinja for a Python package is a choice

I'm having a hard time fully understanding how this works, but I don't think it is simply template substitution. I think it's creating multiple artifacts and completions from the one document. Because of that it's probably much easier if it is a language that can be easily introspected and doesn't support arbitrary expressions.

Okay fair enough then! I'd be interested to see what the rationale was, and if my knee-jerk reaction was unwarranted :)

Re: A guidance language for controlling LLMs

#138
post #50

I’m not understanding how Guidence Accelerating works. It says “ This cuts this prompt's runtime in half vs. a standard generation approach.” and it gives an example of it asking LLM to generate json. I don’t see anywhere how it accelerates anything because it’s a simple json completion call. How can you accelerate that?

The interface makes it look simple, but under the hood it follows a similar approach to jsonformer/clownfish [1] passing control of generation back and forth between a slow LLM and relatively fast python Let's say you're halfway through a generation of a json blob with a name field and a job field and have already generated { "name": "bob" At this point, guidance will take over generation control from the model to ge…

But the model ultimately still has to process the comma, the newline, the "job". Is the main time savings that this can be done in parallel (on a GPU), whereas in typical generation it would be sequential?

Re: A guidance language for controlling LLMs

#139

Earlier quoted context omitted.

But is it a step to greater rigor? Or is it an illusion of rigor? They talk about improving tokenization but I don't believe that's the fundamental problem of controlling LLMs. The problem with LLMs is all the data comes in as (tokenized) language and the result is nothing but in-context predicted output. That's where all the "prompt-injection" exploits come from - as well as the hallucinations, "temper tantrums" and…

The result is actually richer than ‘predicted output’ - it’s a probability distribution over all possible output. Having richer ways to consume that probability distribution than just ‘take the most likely thing, after adding some noise’ is more conducive to using LLMs to generate output that can be further processed - in rigorous ways. Like by running it through a compiler. Think about how when you’re coding, autoco…

Note that for any fine-tuned models (like GPT-4, where the foundation model has not been made accessible) the model does no longer give the "probabilities" of the next tokens, but rather their "goodness". Where the numbers say how good a token would be relative to the aims the model inferred from its fine-tuning.
Post reply on HN