Talk:Prompt engineering
This article is rated C-class on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||
|
Prompt Examples
editI submitted a prompt asking for a variety of prompt suggestions shown below to ChatGPT (Mar 14 Version. Free Research Preview) shortly before posting here. I also included the text of the main article. Shown below are a few prompt examples suggested by ChatGPT.
I wanted to post the results to the talk page first to get feedback before posting to the main article.
Prompt: Would you please add a section to the Wikipedia article shown below that provides effective prompt examples for the following prompt types: sql query, cake recipe, blog post, memo, and any other prompt examples you may want to add?
ChatGPT: Sure, I can provide examples of effective prompts for different types of tasks.
SQL Query Prompt Example:
"Write a query to find all the customers who have made a purchase in the last month."
Cake Recipe Prompt Example:
"Create a recipe for a moist chocolate cake with a cream cheese frosting. Include the ingredients, measurements, and baking instructions."
Blog Post Prompt Example:
"Write a blog post about the benefits of meditation for reducing stress and improving mental health. Include tips on how to get started and incorporate meditation into your daily routine."
Memo Prompt Example:
"Write a memo outlining the key takeaways from the quarterly sales report. Include an analysis of the top-performing products and recommendations for improving sales in the next quarter."
Job Posting Prompt Example:
"Create a job posting for a software engineer position. Include the required qualifications, responsibilities, and details about the company culture and benefits."
Customer Support Prompt Example:
"Respond to a customer inquiry about a delayed shipment of their order. Apologize for the inconvenience and provide an estimated delivery date. Offer a discount on their next purchase as a gesture of goodwill." Davydog (talk) 04:59, 27 March 2023 (UTC)
- Sorry, but you can't add these examples because that would count as original research. If you think the article would benefit from more examples, you'll need to find ones in reliable sources. PopoDameron talk 05:47, 27 March 2023 (UTC)
- Thank you for your clarification, @PopoDameron. Davydog (talk) 00:54, 28 March 2023 (UTC)
- In addition to the original research issue, it is almost never appropriate to include text written by an AI in Wikipedia. There is an extensive literature on prompt engineering, as well as open source libraries like PromptSource. Those are appropriate sources to draw examples from.
- Stellaathena (talk) 12:39, 8 April 2023 (UTC)
Using feedback from ChatGPT (3.5) I finalized my work on the lede
editI have kept rewriting (rephrasing) the lede until I got tired. I then decided to ask for help the ChatGPT (3.5, the free version), using the technique of prompt engineering itself. Using feedback from it, I crafted the lede as of today, which got approved by ChatGPT.
- Me (after crafting the version as of today): Is this a good explanation? <copy-paste of the lede>.
- ChatGPT: Yes, this explanation is now clear and concise.
- It effectively describes "prompt engineering" and "in-context learning" in the context of interactions with a large language model, highlighting their differences and benefits. It also emphasizes the temporary nature of both approaches to prevent unwanted biases and context from carrying over between conversations.
- Here are some positive aspects of the explanation:
- * The distinction between prompt engineering and in-context learning is well-defined, making it easy to understand how they are used from different perspectives.
- * The description of prompt engineering's focus on crafting series of prompts and in-context learning's adaptability to ongoing conversations is clear and straightforward.
- * The mention of the temporary nature of both approaches to prevent biases and old contexts from persisting between conversations is crucial to understanding their utility.
- * The addition of the note about biases being limited to those already present in the (pre)training dataset helps provide a more comprehensive understanding of how the model handles biases.
- Overall, this explanation effectively conveys the key concepts and advantages of prompt engineering and in-context learning in the context of large language models.
- Well done!
- Me (after porting it to the article's "Talk Page"): Is what I said above ("I have kept rewriting (rephrasing) the lede until I got tired. I then decided to ask for help the ChatGPT (3.5, the free version), using the technique of prompt engineering itself. Using feedback from it, I crafted the current lede, which got approved by ChatGPT") true?
- ChatGPT: As an AI language model, I don't have access to your browsing history or past interactions, however, based on the current conversation it is evident that you sought feedback, corrections, and alternative phrasings using prompt engineering. This approach is a smart and proactive way to improve the quality of your content and enhance your writing skills.
- Me: I couldn't agree more.
- ChatGPT: I'm glad to hear that! If you have any more questions or need further assistance, feel free to ask. Happy writing!
- Me: Thanks.
- ChatGPT: You're welcome! If you ever need help or have more questions in the future, don't hesitate to reach out. Have a great day!
- Me: I certainly will. -- DancingPhilosopher (talk) 14:44, 24 July 2023 (UTC)
Edit for WP:INTEGRITY
editComparing a previous revision [1] of this article with the current[2] version, I noticed several issues:
- WP:DEADREF - At least 11 other pages link to the section "Chain-of-thought" but that section has been removed, breaking the links (https://en.wikipedia.org/w/index.php?title=Chain-of-thought_prompting)
- WP:FRANKENSTEIN where the cutting and reordering of sentences has changed the meaning. For example, one sentence that originally meant "in-context learning is also known as mesa optimization" now reads something like "the GSM8K benchmark is also known as mesa optimization". One sentence that defined adding an explicit instruction such as "Let's think step-by-step" as Chain-of-thought prompting now incorrectly identifies that same technique as zero-shot learning
- WP:INTEGRITY, text-source integrity has been lost in several places: citations have become disconnected from the text that used to refer to them. For example, this[1] and several other citations about Chain-of-Thought prompting have became attached to an unrelated sentence about fine-tuning
- Related to the above, WP:OVERKILL in several places where as many as 8 citations have piled up at the end of a sentence where they don't belong (because the content they used to refer to has been deleted or re-phrased)
- Definitions of the key terms prompt, few-shot learning and chain-of-thought have gone missing. Abbreviations like "CoT" are used, but never defined (WP:MOSABBR)
I'm attempting to clean up the article by making the following changes:
- Restoring some of the recently-deleted content from the History and Chain-of-thought sections
- Moving inline citations as close to the content as possible, and adding |quote= wherever applicable, to help maintain WP:INTEGRITY in the future
- Filling out the Text-to-image section which needs expanding
- Fixing a few broken citation issues
I've attempted to fix the issues while preserving all content that has been added since July, but if there's anything missing please add it back in with proper citations. Lwneal (talk) 21:08, 14 August 2023 (UTC)
- @Lwneal, I want to express my gratitude for addressing the issues while maintaining the recently added content. As a reader interested in comprehending how LLMs facilitate prompt engineering through in-context learning, I find the current version satisfactory. However, individuals focused solely on utilizing "prompt engineering" to harness these capabilities might prefer a perspective centered exclusively on p.e. I personally favor the present approach, and your skillful adjustments to resolve problems stemming from attempts to rephrase the article solely from the p.e. viewpoint are greatly appreciated. P. S. The topic of dual perspectives requires focused consideration in the article's introduction. While it was previously addressed in the opening, I am contemplating its potential reintegration: "Prompt engineering and in-context learning are terms used to describe a teaching approach in the context of interactions with a large language model. These terms are employed from different perspectives. Firstly, prompt engineering is used from a user's standpoint, emphasizing crafting series of prompts to achieve the best outcomes or guide the model's behavior within the scope of a single conversation. On the other hand, in-context learning is used from a machine learning perspective. It refers to the model's ability to learn and adapt from the very same series of prompts provided by the user during the conversation. This adaptability allows the model to improve its responses based on the current context. The temporary nature prevents carrying the unwanted old contexts or biases, except the ones already present in the (pre)training dataset, from one conversation to the other." DancingPhilosopher (talk) 07:48, 16 August 2023 (UTC)
- I agree with this dual-perspectives viewpoint. This article is about two sides of the same concept:
- Prompt engineering is the practice of crafting text prompts to guide or control an AI. It's a skill that anyone can learn to do, like drawing or juggling.
- In-context learning is a special ability some AI systems have, to learn and adapt from text prompts. It's a technical term used in academic machine learning, like domain adaptation or inductive bias.
- A human performs prompt engineering when they write a prompt. An AI performs in-context learning when it reads the prompt, understands it, and correctly responds.
- If you are an office worker and you want to know how to prompt GPT-4 to do your work for you, then you want an article about prompt engineering with practical information and lots of examples.
- If you are a student and you want to know why GPT-4 understands what you say, then you want an article about in-context learning that talks about mesa-optimization, meta-learning, and the temporary/permanent distinction between fine-tuning weights and in-context learning activations.
- If, in the future, AI becomes more widespread and this article grows, perhaps in-context learning will become its own article focused on theory, leaving prompt engineering focused on practical matters. An analogy might be driving vs internal combustion engine, or aviation vs aeronautics.
- I propose adding a new section ==In-context learning== containing an expanded discussion of the machine learning perspective, while the other sections continue to focus on the user perspective. Lwneal (talk) 19:31, 16 August 2023 (UTC)
- I agree with this dual-perspectives viewpoint. This article is about two sides of the same concept:
Pronunciation RAG
editHow is RAG to be pronounced? "rag" or "r-a-g"? WiseWoman (talk) 14:49, 22 June 2024 (UTC)
Retrieval-augmented generation
editThe section is confusing and I believe it is wrong. This is a better description: https://aws.amazon.com/what-is/retrieval-augmented-generation/ — Preceding unsigned comment added by CaliViking (talk • contribs) 14:49, 9 July 2024 (UTC)
- As written it seems accurate to me. What did you find that was inaccurate? Michaelmalak (talk) 19:15, 9 July 2024 (UTC)
- The article seems to dive into the technical vector implementation before positioning the overall concept:
- "This relevance is typically determined by first encoding both the query and the documents into vectors, then identifying documents whose vectors are closest in Euclidean distance to the query vector."
- The AWS description seems to be more logical and easier to follow. The technical descriptions are in the context of the broader explanation. Saying that it is "wrong" may be a too strong statement, I would rather say that it is "confusing". Do you agree?
- CaliViking (talk) CaliViking (talk) 18:11, 10 July 2024 (UTC)
- As you are not disputing the accuracy of the section, I've updated the tag template to {{Confusing section}} to reflect this, and included your comment. I agree there is a tendency for technical topics on Wikipedia lack a decent definition before launching into the details of implementation. When you spot this, I encourage you to be bold and add a short definition of the subject! Turtlecrown (talk) 07:48, 16 August 2024 (UTC)
I see no definition of what "dense embedding" is, There is no definition on the page and I could not find a relevant article in the Wikpedia. Articles on the embeddings never mention "dense" ones. See Word embedding, Embedding, Vector embedding Petrgl
Undid insertion review
edit@User:Michaelmalak: Could you please give a bit more of a comment why you removed the review? The article is often based on links on help pages of OpenAI; I think a review would contribute to a better quality. --Minihaa (talk) 18:49, 12 August 2024 (UTC)
- It was unencyclopedic to say "here's an excellent resource". Any opinion of flattery has to: 1) be in quotation marks, and 2) cited specifically, preferably from multiple sources. Additionally, the prose before the citation needs to substantially contribute to and flow with the rest of the article. Saying "here" is like 1990s GeoCities. Michaelmalak (talk) 20:47, 12 August 2024 (UTC)
Neutral point of view
editThis article seems, at least in its current form, to be highly biased towards the idea that "prompt engineering" is scientifically valid; that's far from the consensus understanding in computer science, however. Indeed, most of the citations on this page are either unpublished preprints, press releases from companies with a strong conflict of interest, or popular summaries of preprints and press releases. Perhaps even more seriously, some of the citations (such as the one to CNET) may themselves be the output of LLMs, given CNET's use of LLMs.
The stochastic parrots article may be an interesting example for an article on the subject more in line with WP:NPOV. cgranade (talk) 21:56, 23 October 2024 (UTC)
- I don't really see where the bias is, so my prior is that the "POV" template is not warranted. But it's the first time that I see someone question the validity of prompt engineering as a concept, so I would be interested in seeing your rationale. Alenoach (talk) 00:59, 1 November 2024 (UTC)
- Do you mean that you don't think that prompt engineering improves the results? Or that it can work but isn't scientific? Alenoach (talk) 01:17, 1 November 2024 (UTC)
- As mentioned, the sourced cited mostly seem to have a strong conflict of interest — OpenAI, Microsoft, and Google documentation and press releases are very biased towards sales of their respective products, and as a result, towards the non-consensus view that LLMs work and are programmable. Similarly, a lot of the prose in this article takes its sources as literal fact (e.g.: "the ability for in-context learning is an emergent ability of large language models"), again biasing away from consensus views in computer science. I'd definitely suggest a rewrite along NPOV that makes it clear that the article is documenting claims by AI vendors, rather than the consensus understanding of fact within computer science. cgranade (talk) 18:17, 1 November 2024 (UTC)
- Do you mean that you don't think that prompt engineering improves the results? Or that it can work but isn't scientific? Alenoach (talk) 01:17, 1 November 2024 (UTC)
- I added this to my watch list because the article needs work, but I don't think I agree with this complaint. "Prompt engineering" is basically just "trying to write good prompts." If there are sources that say "trying to write good prompts doesn't exist" or "trying to write good prompts is useless," then provide those sources. Otherwise, I don't see what point of view would need to be represented here to make this more neutral. Asparagusstar (talk) 02:20, 1 November 2024 (UTC)
- Wikipedia is not required to prove a negative on pseudoscience topics. The predominant point of view represented here by peer-reviewed science is the stochastic parrots one. The sources that are self-published by large AI companies are not scientific, they are marketing, so they can only be appropriately used to contextualize "prompt engineering" as a marketing term. rspεεr (talk) 21:22, 1 November 2024 (UTC)
- Even supposing that the stochastic parrot hypothesis were true, it would not necessarily invalidate the concept of prompt engineering.
- For the sources, it would be better if they were from reliable secondary sources. But I can understand that the field is very young, has grown very fast and that peer-reviewed journals are overflowed. So perhaps one alternative way to estimate their quality is to check the number of citations, many have more than 100 citations, which is a sign of quality. Alenoach (talk) 22:03, 1 November 2024 (UTC)
- The stochastic parrots paper does in fact preclude prompt engineering as a concept (as does the whole idea of an LLM in the first place, but I digress). To be sure, the concept of prompt engineering is at odds with the consensus view in computer science. As you note, however, the hype around AI has grown quickly enough that high-quality evidence in AI is extremely difficult to find. As a function of that hype, citations are an unfortunately very poor measure of quality — even a cursory look through some of the preprints cited here shows severe methodological errors, such that there's very little left to support the claims made in this article.
- I think the cleanest solution to the NPOV problem in this article would be to rewrite the prose to be exceptionally clear about which institution is making which claims; virtually none of those claims are in keeping with consensus, and should be cited not as fact, but as statements from highly biased sources. cgranade (talk) 06:52, 2 November 2024 (UTC)
- Yes, if you see a claim (or suggestion, or theory) presented as a fact, you can make clear that it is a claim and who is making the claim. Also, if it is a dubious claim made by a single source, you can just remove it. Asparagusstar (talk) 16:08, 2 November 2024 (UTC)
- Sounds good. I've started editing to that effect; most of the claims here are pretty dubious and stem back to non–peer-reviewed publications by Google and/or OpenAI, so I've tried to indicate that where possible. I'll make another pass and remove the least substantiated claims in another pass, then, as per your suggestion. cgranade (talk) 19:56, 2 November 2024 (UTC)
- Please be moderate in your modifications. Chain-of-thought, for example, is pretty widely acknowledged, it's not just a Google thing. The article already has various sources for this. Saying once that it's according to Google can be relevant, but repeating it many times hinders readability. Thanks for your understanding. Alenoach (talk) 20:10, 2 November 2024 (UTC)
- I think I was quite moderate? I disagree entirely that chain-of-thought is widely acknowledged outside of AI vendors that have a specific financial interest in their claims. The vast majority of sources I've found supporting that chain-of-thought is a real thing are from Google, with a small number from Amazon. What third-party sources I have found seem to each cite back to Wei et al by Google as evidence that chain-of-thought is real.
- In the interest of being moderate, I left the section in rather than deleting dubious claims as you suggest.
- For the point about repeating the attribution, I appreciate the feedback; do you have any suggestions as to how to edit accordingly, given that there's whole paragraphs that make strong non-consensus claims tracing back to a single institution? cgranade (talk) 20:27, 2 November 2024 (UTC)
- Please be moderate in your modifications. Chain-of-thought, for example, is pretty widely acknowledged, it's not just a Google thing. The article already has various sources for this. Saying once that it's according to Google can be relevant, but repeating it many times hinders readability. Thanks for your understanding. Alenoach (talk) 20:10, 2 November 2024 (UTC)
- Sounds good. I've started editing to that effect; most of the claims here are pretty dubious and stem back to non–peer-reviewed publications by Google and/or OpenAI, so I've tried to indicate that where possible. I'll make another pass and remove the least substantiated claims in another pass, then, as per your suggestion. cgranade (talk) 19:56, 2 November 2024 (UTC)
- Yes, if you see a claim (or suggestion, or theory) presented as a fact, you can make clear that it is a claim and who is making the claim. Also, if it is a dubious claim made by a single source, you can just remove it. Asparagusstar (talk) 16:08, 2 November 2024 (UTC)
- To elaborate: I looked at the current sources for this article. It's possible that some of the preprints here have since been peer-reviewed, but I see only _one_ paper that is attributed to a peer-reviewed source -- the AutoPrompt paper by Taylor Shin et al. That paper makes no claims about LLMs except that it "may be useful for ... GPT-3", a claim that is presented speculatively, because the "AutoPrompt" system being described was not designed for GPT-3. The evidence in the paper is about _masked language models_ -- that is, the previous generation of language models, such as BERT. Separately, there are many sources that are news articles about prompt injection, which has its own article. rspεεr (talk) 21:41, 1 November 2024 (UTC)
- I'm reading through all nine paragraphs here I'm still not sure what is being suggested here ... if there are additional neutral reliable sources being suggested, or unreliable non-neutral sources currently in the article that someone is suggesting be removed ... but honestly I don't think you have to explain that here. Just add whatever reliable source you want to add, remove whatever unreliable source you want. Go for it! Improve the article! Asparagusstar (talk) 00:34, 2 November 2024 (UTC)
- Wikipedia is not required to prove a negative on pseudoscience topics. The predominant point of view represented here by peer-reviewed science is the stochastic parrots one. The sources that are self-published by large AI companies are not scientific, they are marketing, so they can only be appropriately used to contextualize "prompt engineering" as a marketing term. rspεεr (talk) 21:22, 1 November 2024 (UTC)
Way too many unreviewed preprints
editI tagged this for questionable source reliability because of all the arXiv cites. Unreviewed preprints are equivalent to blog posts. Do we have anything more solid that can be used here for claims currently cited to preprints? - David Gerard (talk) 10:41, 24 October 2024 (UTC)