
Life on Mars - A podcast from MarsBased
Life on Mars - A podcast from MarsBased
Prompt engineering vs. Spaghetti prompting
Are your ChatGPT prompts messy and inconsistent? You might be falling into the trap of spaghetti prompting, random, unstructured inputs that lead to weak responses.
In this episode, we break down the difference between spaghetti prompting and prompt engineering, showing you how to structure prompts for accurate, consistent, and high-quality results.
What you'll learn:
How to give clear context and set specific goals
Why defining output format matters
The power of real examples
Iterating your prompts like an engineer, not a guesser
Stop wasting time on guesswork. Start prompting with purpose. Listen now and upgrade your AI game!
🎬 You can watch the video of this episode on the Life on Mars podcast website: https://podcast.marsbased.com/
The more effort you put into the first prompt, the less iterations you will be doing afterwards. Prompt engineering I think there are a few things. How do I do you know horizontal aligning with CSS and that's it. And you expect it to produce like the magic right, which is the equivalent of going to Google and asking cats, or why do cats meow at night? Right, which is it's a good, it's a good question, but it's not really good. Right, in google you cannot give a lot of context. But you know, in google there are parameters. Um, you can, you can search, like there are filters, you know site and like site and stuff like that. You can use the minus, like dash, to filter out stuff, say like, oh, I want this, I want front-end development, minus Angular, because I don't want to see anything in Angular. Right, the same happens with ChatGPT, but not a lot of people know what is prompt engineering, what is the context, what is the role, what is like the few parameters? Because there's no clear guides on that. Actually, openai they released the OpenAI Academy last week and not a lot of people knows about that. But if you Google or if you search for OpenAI Academy, there are a few really good tutorials there. I haven't read any of them. Really good tutorials there, I haven't read any of them, but I think it's a good start if you're really starting out Good.
Speaker 1:So what I wanted to share here is a little bit of prompt engineering very basic, and then go into questions. Let me just share my screen because I have an example I've done with ChatGipty. So I have prepared an example of prompt engineering, about prompt engineering, right, so it will be a little bit meta. I hope it's not too complex to understand. But basically, one of the things I have incorporated in the last few months is actually, before doing a query on ChatGPT is asking me sorry, help me to refine the query and write the prompt for me, which is it's kind of like a middle step for accomplishing something. Let's see an example here. Right, you can use this, you can copy this.
Speaker 1:Basically, we use this thread as a prompt refiner and that's something that you can use right away. I will input prompts and you will guide me through questions to get all the necessary information. You need to create the perfect prompt for each task, and this is something that I've been using for months, and just by creating this, your, your usage of chat gT will be much better, right? You will see it in a moment. Once you have the information, you will rewrite the prompt and explain it to me in terms of every item in Instructor so we can fine tune and do flawless prompt engineering. This is a pretty good ask for ChatGPT to help you with this right.
Speaker 1:For instance, an example I prepared for today is somebody asked me like how can I use AI for financial planning and tracking my investments? Well, three months ago I would have written this hey, help me do my financial planning and tracking my investments. It would be like a really shit prompt, right. And basically, you know, chatgpt is like having an intern that if you give really shit instructions, you get shit outputs. If you give really good instructions and you take the detail to refine and structure and give examples, stuff like that, the output of ChatGPT becomes really really good. So let's see an example. Okay, this is a shit prompt.
Speaker 1:I want to start using AI for financial planning and tracking my investments, because it doesn't have context, it doesn't set the tone, it doesn't indicate any kind of examples. What is the desired output? There's nothing. So AI will be like whatever, because this is a prediction model we'll be like I'll try to predict something and it will predict terrible stuff. Okay, so if you use this and to help you to write better prompts, you will see that it helps. Let's start.
Speaker 1:You get this and then it comes back with a few questions. Right, okay, clarification questions, objectives what is the data source, like the formats, blah, blah, blah. It will ask about investment types. What kind of investments are we tracking? What is the frequency? What is the know? What tools do you want to use? Do you want to integrate? Do you want to build code? What is your risk tolerance and profile and terms of privacy? You know it gives eight questions that I answer here, and once I answer this with more or less detail, now it gives you the prompt, and this prompt is much better because if you use this prompt, you will get a much better outcome than you would have gotten with the first one, and you can test it If you do testing on your own. Create a thread, give the first prompt the terrible one and then create another thread, not in the same one and give this one, and you will see that the quality is immensely better in the second example.
Speaker 1:So here we got the version one, which is good enough. It helped me create an AI-assisted system. Blah, blah, blah. I want to. You know it gives more. It gives a little bit more context. It gives exactly what you want it gives. It explains the output dashboards with charts and summaries, how you will enter the data, what kind of data should it expect and what more instructions about how to use.
Speaker 1:And here, actually, this is more verbatim, this. Probably you don't need this level of detail, but it's good. Why? Because prompt engineering is something that people have had to reverse engineer. Right, it's like oh, I've tried these things, they work. I've tried these other things, they don't work. But, more importantly, if you follow AI influencers on Twitter and they are not scientists they're probably saying bullshit. For instance, I remember back in like a year ago, they would be sharing like, oh, I created this image and they would be putting like parameters, like the style of the camera, the I don't know the technicalities of I'm not good at photography, but I know like this, like the focal point and the lightning, blah, blah, blah and this kind of film. And somebody from OpenAI actually came out and said, like we don't process these parameters, like this is bullshit. But a lot of people believe that, right, but actually, if you the the entire model here or you read the documentation, there's something that is true here.
Speaker 1:So, for instance, you know, um, when you write your prompts, it's good to sell. Set the goal, right. A lot of people don't set the goal, like what's the purpose of the question, right? Uh, um, you know, um, for instance, I wanted to I will see some examples later right? Or give me ideas for content marketing. Yeah, what's the goal? Is it the MarsBase blog? Is it the MarsBase podcast? Is my personal newsletter? Is my social media accounts? Do I have an account for something else? Is it because my clients want content? What's the goal? Right? Context, more or less the same, right? Why do you want to do it and what information can you give me about that? I spend like a good 10 minutes writing that and I know that sounds like a lot of effort, but the more effort you put into the first prompt, the less iterations you will be doing afterwards by answering these questions here. It explains why this is important.
Speaker 1:Right, the output format. You know, most of the times we ask for questions to an AI, but we don't give examples of how do we want the output. Oh, give me fake names for simulating user registrations in this application and I was like, okay, fine, here's a list of names and it gives you a bulleted list, but said, oh, now I need it in JSON format. Well, why didn't you specify it in the first place? You know what I mean. Like, it's better to spend a little bit more time thinking through and providing like a really good uh prompt in the first place to avoid iterations, right, um, you know, by answering these questions, you know? Um, it gave me actually more stuff to refine it better. So, more questions. Then I answered these questions and now refine prom final version.
Speaker 1:You, you know, use this one and probably it's going to give you better examples than the, than the um, than the first one. So this is the example I prepared. Like, feel free to experiment on your own. Um, I do have other stuff. I've been playing with a voice. I've been playing it with you know the different models, not so much. There's the integration with the Notes app. I don't know. Feel free to shoot questions.
Speaker 1:I wanted to open it up for you guys. But did you try this, like sending him, like a dummy, data Excel and see what's going on with the charts or with tables or with something. Yeah, I don't remember the specifics, but I have my financials. I have on a Google Sheets, right. I haven't given all of the information, not for privacy issues, but because I really don't. I really didn't know what to what to ask. I've gone for very specific things, like sometimes I go like I screenshot a part of it and I say I don't know, I want to accomplish this. Like, for instance, oh, I've got these annual returns on my financial investments and stuff like that and I want to calculate these other metrics, but I don't know the formula. Can you give me the formula? Here's the data and here's the entire sheet so you can see the cells right, and because it can see the cells, it can provide you with the exact formula. Yeah, that works. Like, for instance, that is a really good example is a really good example For other stuff that I do all the time with AI, for instance, is transforming images.
Speaker 1:Like, for instance, you know I want a vectorial version of this image. You know here's the vectorial image. Or you know it gave me two versions, like one with auto-trace could simplify, I don't even understand what that is. Give me this and then now give me the other options, stylized, pre-interpretation, optimized to be used, so stuff like that, right? Or what is the other one? Give me?
Speaker 1:There's another one that is for this one. Give me the list of panels. Like. This is for a blog for Mars Space. I was like, oh fuck, I need the list of people who spoke at the Corporate Innovation Summit and I always have to type it manually. No, you know it's. Hey, I've got this image. I mean, you probably cannot see it, but basically, this is the panel and because the information of the speakers is here name, role and company give it to me in this format. Now, great, I copy pasted this into the block. Perfect, it saved me 10 minutes of doing this. Really stupid test. Yeah, but this, for instance, this is like the case that I really like. Like, using this to quickly get something.
Speaker 1:The idea of spending one hour redefining the prompt and, in the end, finally get the result. It's like well, forget, forget it, I'm going to do it myself. Most likely, I'm not going to spend one hour. No, I mean, depends on the complexity of the task. Uh, there was another one that I did, like this. Uh, for instance, let me see okay, here things here. A client sent me this, right, it's like's like a potential client. It's like oh, this is the kind of box that we have in the application. It's like yeah, great, it's a screenshot of an Excel and I'd like to copy this into linear, but I cannot. So give it the text of this image, fine, great. And here I probably should have said give it to me markdown, because I want to put it in a linear, but it was sufficiently easy that here you copy paste it into linear. It works right.
Speaker 1:But sometimes you want specific formats. For instance, apple Notes doesn't have like markdown from the get-go. Or you want Google Docs it's a specific kind of markdown, so stuff like that you can optimize. For that. Say like, hey, give me this, but the output has to be something that I can copy paste on Google Docs. That looks great and boom, it works right. So it's a good example.
Speaker 1:This one was more, you know, a longer one, right? That's the thing that I'm trying basically to say that the value right now for me, it's for these kind of things not to spend an hour really finding a problem. Okay, like, yeah, unless. No, because. Okay, because you're using the AI as like an intern for really simple tasks, right, there's something like but sometimes you really want the other one, you really want something more specific. It's amazing Like simple things that you can process fast and easy, just like these examples. Or, for instance, in Cursor, where we have the tab and it's like I don't know stronger or muscular autocomplete. All of these are like simple tasks. Yeah, exactly, well, sometimes I have discussions, okay, yes, because, well, I need to discuss with someone, I need to speak with someone. Let me speak with a robot. This is sad, but anyway, the thing is that sometimes I get ideas with these kind of conversations with him, that now the thing is redefining prompts, spending time building prompts. It's a pain, like for me. Like, doing the parallelism with coding is like the way we're using chat and conversational stuff is like writing spaghetti code. You're writing spaghetti code Like, oh, I want this. Like, for instance, let's see the same example Help me track my investments and financial data.
Speaker 1:Okay, yeah, step-by-step data. Okay, yeah, step-by-step plan. Okay, yeah, let's see if this works. Maybe, maybe it works. Maybe it has like some context behind blah, blah, blah. But like, for instance, it will talk about like crypto. I don't do crypto or loans. I don't have loans or credits or deposits. I don't have this right and so because I didn't give it enough context, or maybe I want something else, right, I want it for. Okay, now, it has context behind because if you look at this, there's Wallapop sales and Wallapop sales. I'm sure that not a lot of people track that. I do track that and, because I asked it on the other thread, it does have this context. Okay, right, um, otherwise it wouldn't be so sorry.
Speaker 1:So what you are saying is that redefining a prompt? It's more or less like having this conversation when I'm coding no, no, no. For me it's like no, no. Now, what I'm trying to say I'm sorry, I'm not conveying the right idea is like if you don't think your, your, your um, your prompt correctly, it's like starting a task, a development task, that hasn't been defined by the, by the tech lead, right, if, if the functional and technical definition is not good, you will do something and maybe the client doesn't want, it, doesn't really integrate well, and blah, blah, blah, and maybe it's spaghetti code or something. And by spending time on engineering your prompt, right, it's like doing a good definition of a task.
Speaker 1:Hey, here's like the controller that you got to use. Like this is the use case, this is expected output, like the application should do this. This is how you test it. This is like you know. It has to run under this number of milliseconds per petition and stuff like that. So stop doing spaghetti prompting and start investing time in providing this. I think because I use it a lot and I've seen that most of the times I'm like, oh fuck it, like it didn't give me a good answer. No, it didn't give you a good answer because the question was not right, it was a shit question. Shit questions give shit answers. So, and that's why I'm now more than ever like spending more time on the initial prompt and you know, as a result, I also do it in the kind of requests I do to people that work with me. It's way more defined now than it used to be in the past because of this.