Live data from Hacker News

Brex’s Prompt Engineering Guide

github.com

31–40 of 112 posts

Re: Brex’s Prompt Engineering Guide

#31
post #20

YAML is just as effective at communicating data structure to the model while using ~50% less tokens. I now convert all my JSON to YAML before feeding it to GPT API's

I've heard this a lot but don't understand where this idea comes from. With JSON you can strip whitespace whereas with YAML you're stuck with all these pointless whitespace tokens you can't do anything about. I would recommend the exact opposite, JSON is just as effective while using less tokens. This example JSON: {"glossary":{"title":"example glossary","GlossDiv":{"title":"S","GlossList":{"GlossEntry":{"ID":"SGML",…

I keep going back and fourth between the two.

I have absolutely no proof but sometimes feel like the responses I get are weaker if there is no white space in the structured data.

Re: Brex’s Prompt Engineering Guide

#32
post #18

Are there established best practices for "engineering" prompts systematically, rather than through trial-and-error? Editing prompts is like playing whack-a-mole: once you clear an edge case, a new problem pops up elsewhere. I'd really like to be able to say, "this new prompt performs 20% better across all our test cases". Because I haven't found a better way, I am building https://github.com/typpo/promptfoo , a CLI t…

Great work, the space needs some more tooling in this direction.

Re: Brex’s Prompt Engineering Guide

#33
post #20

Earlier quoted context omitted.

I've heard this a lot but don't understand where this idea comes from. With JSON you can strip whitespace whereas with YAML you're stuck with all these pointless whitespace tokens you can't do anything about. I would recommend the exact opposite, JSON is just as effective while using less tokens. This example JSON: {"glossary":{"title":"example glossary","GlossDiv":{"title":"S","GlossList":{"GlossEntry":{"ID":"SGML",…

I keep going back and fourth between the two. I have absolutely no proof but sometimes feel like the responses I get are weaker if there is no white space in the structured data.

This is fair, typically I supply data as compact JSON but ask for responses as pretty printed JSON which is quite a large token penalty but tends to strongly reduce malformed JSON outputs.

Re: Brex’s Prompt Engineering Guide

#34
Thanks very much for posting this! I haven't yet finished reading the whole thing, but even just the first section about the history of LLMs, explaining some of the basic concepts, etc., I found to be a very well-written and useful info, and it was really nice that it linked out to source material. So many times when you go into reading stuff about the latest AI technique or feature it can feel like you need to do a ton of background reading just to understand what they're talking about (especially as the field moves so quickly), so having a nice simple primer at the beginning of this doc was most appreciated!

Re: Brex’s Prompt Engineering Guide

#36

Thanks very much for posting this! I haven't yet finished reading the whole thing, but even just the first section about the history of LLMs, explaining some of the basic concepts, etc., I found to be a very well-written and useful info, and it was really nice that it linked out to source material. So many times when you go into reading stuff about the latest AI technique or feature it can feel like you need to do a…

…was this written by an LLM?

I’m starting to doubt anything on the internet that’s overly cherry and polite.

Sigh.

Re: Brex’s Prompt Engineering Guide

#37
post #20

YAML is just as effective at communicating data structure to the model while using ~50% less tokens. I now convert all my JSON to YAML before feeding it to GPT API's

I've heard this a lot but don't understand where this idea comes from. With JSON you can strip whitespace whereas with YAML you're stuck with all these pointless whitespace tokens you can't do anything about. I would recommend the exact opposite, JSON is just as effective while using less tokens. This example JSON: {"glossary":{"title":"example glossary","GlossDiv":{"title":"S","GlossList":{"GlossEntry":{"ID":"SGML",…

Nothing. They just didn’t realize that JSON doesn’t need to be pretty-printed :)

Re: Brex’s Prompt Engineering Guide

#38
post #9

This is a question borne of ignorance: why does Brex, a bank, care about AI like this?

FYI Brex isn't a bank although they do have a business account product similar to a checking account.

To answer your question though, Brex uses AI for a lot of things some of which being:

1. Fraud/Risk/Underwriting

2. Auto-generated receipts and data enrichment

3. AI assistants for all users that have a ton of capabilities

There's a lot more as well but these are just some of the obvious ones.

Re: Brex’s Prompt Engineering Guide

#39
post #37
post #20

Earlier quoted context omitted.

I've heard this a lot but don't understand where this idea comes from. With JSON you can strip whitespace whereas with YAML you're stuck with all these pointless whitespace tokens you can't do anything about. I would recommend the exact opposite, JSON is just as effective while using less tokens. This example JSON: {"glossary":{"title":"example glossary","GlossDiv":{"title":"S","GlossList":{"GlossEntry":{"ID":"SGML",…

Nothing. They just didn’t realize that JSON doesn’t need to be pretty-printed :)

In my experience, the non-human characters cause GPT a lot of problems. They break a lot of the magic of GPT.

Re: Brex’s Prompt Engineering Guide

#40
post #36

Thanks very much for posting this! I haven't yet finished reading the whole thing, but even just the first section about the history of LLMs, explaining some of the basic concepts, etc., I found to be a very well-written and useful info, and it was really nice that it linked out to source material. So many times when you go into reading stuff about the latest AI technique or feature it can feel like you need to do a…

…was this written by an LLM? I’m starting to doubt anything on the internet that’s overly cherry and polite. Sigh.

Reads like a normal comment to me. Doesn't seem like ChatGPT's typical writing style. It has far too much texture.

As someone who people often find stiff and formal, I'm really not looking forward to being accused of not existing more and more often.

Post reply on HN