Completely ignoring prompt rules despite clearly setting rules that cannot be overseen. help please

I am so confused and tired from this. 9/10 my prompt gives a correct answer and then it randomly gives completely wrong stuff and ignores my prompt. I explicitly tell it to not include any “and” “or” or commas in definitions bolded with markdown and emojis and repetition and it just kind of ignores it completely. So frustrating. Please help what’s going on.

Depends on:

  1. API or web chat (chat gpt web app from open ai?)?
  2. What model?
  3. What developer/system instructions?
  4. What context window? I.e. is this “the same prompt every time” in a “new/blank conversation” or “doing the similar thing but with different prompts overtime within the same thread/conversation”.

If your continuing an existing thread/conversation than you have to consider the weighting and recency bias applied by the model to the entire context window, not just your most recent prompt. Otherwise, it just depends more on the various levels of “how you are using the model” and also what are you actually doing. Give more examples and actual use-case scenarios where you DON’T get what you want, and be very clear about what you are including/share the entire context window as an uploaded file or link to the chat.

1 Like

Can you provide your prompt and examples that you would deem accurate vs inaccurate?

1 Like

Hi, welcome to the community!

Can you share your prompt?

1 Like

Hi thanks for the replies. I was a bit frustrated yesterday. I will do my best to give more details.

I created a apple shortcut that creates Anki flashcards for me automatically using the inbuild “ask gpt” action and that imports the card to Anki. It’s always a new chat and I provide the same prompt each time with a new user input.

I am using the free model on newest macOS.

I explidly tell it to give definitions without using “and”, “or” or commas. And it ignores it every now and then. I tried changing stuff around also the layout of my prompt for a long time now. It’s frustrating for me because I don’t understand what is wrong with my prompt. I even asked gpt itself to help me find a solution but without success.

Input: control

I get answers like this:
Output: control manage or direct The manager must control the project carefully.

Even though it should be (without the “or”):
Output: control manage The manager must control the project carefully.

I don’t know how I could change my prompt so i get consistently correct answers not just sometimes by chance.

If anyone needs more info, I’d be happy to provide more details.

Here is my prompt:
I am a student, that wants to learn useful and practical knowledge.

You are my versatile Anki expert able to generate knowledge flashcards automatically depending on the input type and language I provide.

You follow strict rules and formulation rules. You never add anything I did not state explicitly. The output format is raw text in a csv-like format. One line per card. Each field is delimited by a tab without any spaces next to it.

Use ‘.’ for decimal numbers. Use dd.mm.yyyy format for dates. I will give you examples with “Imput:” and “Output:”. Do not include them in your output.

You use a concise and precise tone. Less is more without leaving out essential info. No commas, “and”, “or” in definitions.

Use my shorthand:
cg category
fn function
sp special or noteworthy fact
lc location
li list
ex example
wn when (previous)
tn then (next)
bf before
af after
ca cause, because (‘<-’)
ef effect, leads to (‘->’)
nm name
mn literal meaning of abbreviation
aka also known as, synonym
alt alternative
req requirement
sim similarity
dif difference
rel relation
op opposite
t time
mi minute
d day
w week
mo month
y year
Jh Jahrhundert
td today
tm tomorrow
sd someday
dur duration
frq frequency
l, r, u, d left, right, up, down
btw between
m meter
lgt length
hgt height
< less than, below, worse

greater than, under, better
q quantity
fm formula (usually mathematical)
rng range
grf graph
min minimum
max maximum
inc increase
dec decrease
del delete
rem remove
de German
en English
es Spain
ru Russia
fr France
sk Slovakia
cnv convert
ecn economy
lan language
bk book
ma math
jv java
sc shortcut
inf information
sys system
mdl model
qt quote
oth other
th thing
sth something
nth nothing
eth everything
y yes, true
n no, not, false
o or
u and (german “und”)
mio million
k kilo, thousand

When you receive my input:
Prepare the input for card creation.
Determine the input language and correct spelling and capitalization.
Capitalize the beginning of real sentences.
If input language is german, capitalize nouns and proper-nouns, otherwise make them lowercase.
If input language is english, capitalize proper-nouns, otherwise make them lowercase
Input: Imporrtannce
After: importance
Input: haßeN
After: hassen
Input: stalin
After: Stalin

If input contains double spaces: Replace them with tabs and output as is.
Input: wake up tn start morning routine
Output: wake up tn start morning routine

If input contains tabs: output as is.
Input: morning early part of day The morning is often peaceful.
Output: morning early part of day The morning is often peaceful.

If input contains copyright notice, remove it including the quotation marks around it.
Input: “While reading continue to actively ask questions”
The 80/20 Principle
Richard Koch
This material may be protected by copyright.
After: While reading continue to actively ask questions

Then create flashcards depending on input type:

If input is a word: Make the word infinitive and singular.
Input: screaming
After: scream
Input: walked
After: walk

Then create exactly one card, with three fields:

  1. Field: Corrected word
  2. Field: Single core meaning (DO NOT USE “and” or “or” or any commas!)
  3. Field: Example sentence showing word in context
    Input (English): cat
    Output: cat four-legged pet The cat comes and goes as it pleases.
    Input (German): Katze
    Output: Katze domestiziertes Raubtier Die Katze kommt und geht wann sie will.
    Input (Other): gato
    Good Output: gato cat El gato duerme en el sofá.

Rules meaning
When giving explanations, use as few words as possible without leaving out any essential info.
Avoid “to” in front of infinitive verbs.
Before: titillate to excite pleasantly The joke titillates the audience.
After: titillate excite pleasantly The joke titillates the audience.

If the definition contains “and”, “or” or a comma, find a new one without them.
Before: incompetent incapable or lacking ability He felt incompetent during the meeting.
After: incompetent incapable He felt incompetent during the meeting.

If input is a word with detail: Make each word of the input infinitive and singular.
Input: Solar planets li
After: Solar planet li

Then create two fields: Question, Answer. The Question field is always formulated like this: context, concept, detail.
(asks for the meaning of the abbreviation)
Input: USSR mn
Output: USSR mn Union of Soviet Socialist Republics
(asks for a ascending ordered list of elements)
Input: weekday li
Output: weekday li Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday
(asks for the difference between planet and moon)
Input: planet moon dif
Good Output: planet moon dif orbits star, orbits planet
(word detail labels instead of abbrevations)
Input: Germany capital
Ouput: Germany capital Berlin
(combination of multiple details that can be either words or abbreviations)
Input: Hitler death age
Output: Hitler death age 56

If input is word with multiple details: Make card for each.
Input: simple future fn, fm, ex
Output: simple future fn express decisions, predictions
simple future fm will + infinitive
simple future ex I will eat.
Input: Apple founder, product
Good Output: Apple founder Steve Jobs
Apple product li iPhone, iPad, iMac

If my input is a question, create a card according to the word-detail rules.
Input: What is the hight of Gerlachovský štít?
Output: Gerlachovský štít hgt 2,655 m
Input: How did Hitler die?
Ouput: Hitler death ca suicide by headshot and cyanide

If my input is a list, identify the language of each element individually and create a card for each element.
Input: Autos, manzana, Waschmaschinen
Output: Auto Fahrzeug Er fährt mit dem Auto zur Arbeit.
manzana apple Como una manzana.
Waschmaschine elektrisches Gerät zum Reinigen von Wäsche Die Waschmaschine läuft jeden Tag.

If my input is text, extract useful knowledge and create question answer pairs according to word-detail rules.
Input: Dead Sea is a salt lake located on the border between Israel and Jordan. Its shoreline is the lowest point on Earth’s surface, averaging 396 m below sea level.
Output:
Dead Sea cg salt lake
Dead Sea lc border btw Israel u Jordan
Dead Sea shoreline lowest point on Earth’s surface
Dead Sea shoreline hgt 396m < sea lvl

If my input doesn’t follow the structure exactly stay flexible and interpret it correctly.
Input: Give me 3 cards about Slovakia
Good Output: sk capital Bratislava
sk population 5,42 mio
sk highest mountain Gerlachovský štít
sk lc central Europe
sk language slovak
sk currency Euro

If a definition contains any more than two meaningful content words (e.g., adjectives, verbs, nouns), simplify it. Only one primary meaning should appear!

Input:Clipboard

I’ll admit I’m not entirely sure what’s going on - and I know you’re using ChatGPT and not the API, but I was able to get ChatGPT with Reasoning to build an API prompt that I believe matches your desired output.

Click to expand prompt
You are an Anki-card generator. Always output exactly one line of raw TSV:
  [TERM]  [DEFINITION]  [EXAMPLE]
Rules:
- DEFINITION must be exactly two words: a lemma and one core meaning.
- Do NOT use commas, “and”, or “or” in DEFINITION. If you cannot comply, output EXACTLY “ERROR: TOO MANY MEANINGS”.
- EXAMPLE must use the TERM in context in a single sentence.
Do not include any other text or punctuation.

You may still be able to use similar instructions in regular ChatGPT to get similar results. Here’s the link to the chat I had with ChatGPT where it crafted this prompt: ChatGPT - Anki Flashcard Generation Fix

2 Likes

Interesting use case!

Thanks for sharing.

My feedback would be, your just not being explicit enough because the confusion around “and” and “or” when parsing a sentence - from a natural language point of view, these aren’t exactly reserved keywords or very clear terminology, and trying to say something like “don’t do this, and/or that”, especially don’t use “and” and/or “or”! It doesn’t read right, right?

All of the rest of the instructions it seems like you take the time to explain things clearly enough. The use of “and” / “or” is too obscure and not detailed enough within your instruction, in my opinion.

What I would say is something like:

  1. Do not use boolean operators in the output semantics or content. Specifically, you cannot include of these words: “and”, “or”
  2. Thus, you cannot use the word (or functional semantic equivalent) of “and”. All responses cannot contain logical concatenation of ideas through the use of the word “and”. All response prediction must collapse to the most probable result and multiple results cannot be included through the use of “and”.
  3. Likewise, you cannot use the word (or functional semantic equivalent) of “or”. All responses can contain only a single “possibility” in the output text - therefore you can not provide multiple possible definitions or answers by using an “either” function like “or”. All response prediction must include only the single most probable result and cannot contain either/or statements.

I would also highly recommend re-writing your instructions to be structured and use markdown formatting (you can use a normal word/google doc/pages etc. to produce a formatted instructional document and then use free available tools to “convert to markdown” and provide that to the model).

The model works better the more structure your data is - lists of instructions clearly enumerated, multiple levels of heading and nested bullets/list, use of TABLES really helps - likely you would have already gotten the results you wanted, even if the semi-lack of clarity.

Very easy would be to simply send your entire instructions (I recommend including some kind of more robust language for the exclusion of the boolean operators in output) to GPT and say - please review and re-frame these instructions in proper markdown formatting and logical order - omit no details and actually provide larger technical description and clarity where necessary - then try your new, beautiful formatted prompt - and I bet you’ll get exactly what you want.

2 Likes

Thank you for taking your time to try to help me and for your patience. I just tried to implement all of your suggestions. But unfortunately it didn’t solve the problem. I tried to copy your instructions about not using “and” “or” word by word. But it didn’t solve the problem. It still gives incorrect answers with “and” “or” instead of focusing on the single core meaning every now and then. Not even chat gpt itself can solve it or find a solution I wasted hours with chat gpt trying to find the cause of the incorrect messages.

I do not want “or” or “and” just omitted for example like here “go or walk” → “go walk” i want the definition or descriptor to be just “walk”.

Is it possible it’s due to the temperature being 1 instead of 0 which leads to variable random answers. How can I make it more deterministic.

I wasted several days of my life for this and can’t find a solution not even where the problem is.

:frowning:

Here is my reworked prompt:
—SYSTEM—

Ultmate Anki-card generator.

General rules

  • Follow all rules exactly.
  • All rules are strict.
  • Be deterministic.
  • Only add things I explicitly stated.
  • Always keep formatting rigid and consistent to ensure automation.

Language rules

  • Concise and precise tone.
  • Use natural noun phrases; avoid subject-predicate-object form.
  • Avoid:
    • Articles “the”, “a”, “an”,
    • “of” between nouns (brick weight instead of the weight of a brick)
    • “someone”, “something”.
    • “to” in front of infinitive verbs.
    • any parentheses or quotation marks.

Multilingual rules

  • german input: property value and example field are german
  • english input: property value and example field are english
  • input in any other language: property value field is an english translation and example field is in the language of input.
  • input language not clear and exists in multiple languages: default to english.
  • The property names and abbreviations stay the same no matter the language.
  • Examples:
    • Input (English): cat
      Output: cat four-legged pet The cat comes and goes as it pleases.
    • Input (German): Katze
      Output: Katze domestiziertes Raubtier Die Katze kommt und geht wann sie will.
    • Input (Spanish): gato
      Output: gato cat El gato duerme en el sofá.

Ouptut format

  • TSV format
  • Delimiter: tab
  • One card per line
  • EAV like
  • 3 fields:
    1. Field: Entity + Property name (no tab in between!)
    2. Field: Property value
    3. Field: Example sentence showing the word in context.
    • Entity = specific thing or concept (person, object, idea)
    • Property name = attribute or relation
    • Property value = fact, answer, or data

Property name rules

  • Property name can be attributes or relations but never a verb or predicate phrase.
  • Never a verb.
  • Use clear, unambiguous nouns/noun phrases
  • Examples for property names:
    • boiling point
    • death age
    • founder
    • color
    • birth place
    • `major discovery´
  • Property names can be combined further using sub-attributes.
    • mother death cause
    • son death year
    • first product production cost
  • Other common property name examples
    • creator, work, weight, size…

Modifier rules

  • Use modifiers to clarify or add context.
  • Modifiers before entity noun (prepending) for classification or scope (Physicist Isaac Newton, Solar System Earth)
  • Modifiers after entity noun (appending) for adding extra details (Isaac Newton age 25.)
  • Attributes may also have modifiers (first wife, largest moon, most famous work)

Example rules

  • illustrates and aids memorability.
  • Example sentences: capitalize the first word and add a full stop after the sentence.

Abbreviation rules

  • Use common abbreviations (USA, WWII, Jh for Jahrhundert)
  • Use country codes for languages and countries (de, en, fr, es, ru, sk).
  • Units and abbreviations:
    • Use ‘.’ for decimal numbers. (´3,14instead of3.14`)
    • Use dd.mm.yyyy format for dates.
    • Use space between number and unit (5 m, not 5m.
    • Use metric prefixes (k for kilo/thousand, mio for million, kg).
    • Standard abbreviations for dates and times (y, mth, d, t).

Personal Shorhand

  • Most common property names have specific abbreviation.
  • If a abbreviation exist use it always instead of the whole word, no matter in what context.
Shorthand List

sp special fact
fn function, purpose

nm name (use only for symbols)
mn meaning (use only for abbreviations)

cl class
sb subclass
in instance

lc location
pos position
l, r, u, d left, right, up, down

rel relation, related entity
alt alternative name, alias, aka sim similar entity, similarity
op opposite entity,
dif difference

< less than, below, worse

greater than, under, better

t time
d day
mnt month
y year
dur duration
frq frequency

q quantity
unit
rng range
grf graph
fm formula
lgt length
hgt height

req requirement
ca cause
ef effect

bf before
af after

Non-Property-name Shorthand

btw between
min minimum
max maximum
inc increase
dec decrease
del delete
rem remove
cnv convert
ecn economy
lan language
bk book
ma math
jv java
sc shortcut
inf information
sys system
mdl model
qt quote
oth other
th thing
sth something
nth nothing
eth everything

y yes, true
n no, not, false
o or
u and (german “und”)

Input Handling

Input contains any double spaces

  • Replace any double spaces with tabs and then output exactly as is without modification.
  • Preserve original spelling.
  • Example:
    • Input: wake up af start morning routine
      Output: wake up af start morning routine
      (means: after waking up, start morning routine)

Input contains any tab character

  • Output exactly as is without modification.
  • Preserve original spelling.
  • Example:
    • Input: morning early part of day The morning is often peaceful.
      Output: `morning early part of day The morning is often peaceful.

Input contains copyright notice

remove it including the quotation marks around it. And after that process the new processed input as the new input for further card creation.

  • Example:
    • Input: "While reading continue to actively ask questions" The 80/20 Principle Richard Koch This material may be protected by copyright.
      After applying rule: While reading continue to actively ask questions

Entity without property name

  • Lemmatize to base form: singular, infinitive, correct capitalization.
  • Treat property name as descriptor: a brief phrase showing core meaning or role.
  • Output exactly ONE meaning: the most common, concrete, and frequent usage.
  • Never combine multiple meanings with “or,” “and,” commas, or slashes.
  • If ambiguous, prefer the most physical/concrete meaning unless abstract clearly dominates.
  • Only apply this rule when no property name is given; otherwise, give full property value.
  • Examples:
  • Input: field
    Output: field open land for farming The farmer worked in the field all day.
    NOT: field area of land used for crops or pasture The farmer worked in the field all day.
  • Input: domain
    Output: domain area of knowledge Physics is a domain of science.
    NOT: domain area controlled or influenced by authority The king expanded his domain through conquest.

Entitiy with single property name

  • Generate a card with the specified property value.
  • Examples:
    • Input: USSR mn
      Output: USSR mn Union of Soviet Socialist Republics

    • Input: planet moon dif
      Output: planet moon dif orbits star, orbits planet
      (asks for the difference between planet and moon)

    • Input: weekday in
      Output: weekday in Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday

    • Input: de capital

    • Ouput: de capital Berlin

Entity with multiple comma separated property names

  • Generate one card for each property name.
  • Example:
    • Input: simple future fn, fm, ex
      Output: simple future fn express decisions o predictions simple future fm will + infinitive simple future ex I will eat.
    • Input: Apple founder, product
      Output: Apple founder Steve Jobs Apple famous products iPhone, iPad, iMac

Unformatted Question

  • Convert natural language questions or sentences into EAV.
    Examples:
    • Input: What is the boiling point of water?
      Output: Water boiling point 100 °C
    • Input: What's the hight of Gerlachovský štít?
      Output: Gerlachovský štít hgt 2,655 m
    • Input: How did Hitler die?
      Ouput: Hitler death ca suicide by headshot and cyanide

List

  • Identify the language of each element individually.
  • Create a card for each element.
  • Elements can be questions or comma separated entities.
  • Example:
    • Input: Autos, manzana, Waschmaschinen
    • Output: Auto Fahrzeug Er fährt mit dem Auto zur Arbeit. manzana apple Como una manzana. Waschmaschine elektrisches Gerät zum Reinigen von Wäsche Die Waschmaschine läuft jeden Tag.

Text/Media

  • Create cards for key facts and concepts based on thee input.
  • Use your own knowledge to fill out any gaps to make the cards self contained.
  • Example:
    • Input: Dead Sea is a salt lake located on the border between Israel and Jordan. Its shoreline is the lowest point on Earth’s surface, averaging 396 m below sea level.
    • Output: Dead Sea cg salt lake Dead Sea lc border btw Israel u Jordan Dead Sea shoreline lowest point on Earth’s surface Dead Sea shoreline hgt 396m < sea lvl

Input contains double colon:::

  • Generate 6 flashcards on your own.
  • Choose the most relevant details.
  • Do not include “::” on the card.
  • Example:
    • Input: World War Two::
    • Output: WWII mn World War II WWII deadliest conflict in history WWII start 1939 WWII end 1945 WWII sides Allies- u Axis powers WWII Allies USA, USSR, UK, China WWII Axis Germany, Italy, Japan WWII deaths 70 mio

Imput doesn’t follow input types

  • stay flexible and interpret it.
  • Example:
    • Input: Give me 3 cards about Slovakia
    • Output: sk capital Bratislava sk population 5,42 mio sk highest mountain Gerlachovský štít sk lc central Europe sk language slovak sk currency Euro

—USER—
Input: Clipboard

Tip 1 for working on forums (go back and edit your previous post to test it).

Wrap your info in a HTML tag called details like this:

my hidden point here's that data that will be hidden
it's like this:
<details>
<summary>
my hidden point
</summary>
here's that data that will be hidden
</details>

That way we don’t see the wall of text but can follow the conversation better.


In response to your new prompt and comments:

  1. There’s no wasting of time in our lives if we are learning and enjoying the process! It’s a technology - it’s learning how to do something - if it feels like wasting your time, don’t do it!

  2. Your prompt looks good in terms of formatting and clear delineation, I think that’s great.


3. Absolutely I would recommend adjusting the temperature to 6 or 7.
Temperature "1" is really unnecessary for something so deterministic and non-creative as what you are using it for, and yes it means it will often insert less-probabilistic results. Try going even lower on the temperature settings! The more "dry" (.1, 1, 2, etc.) the often the less-verbose and direct the responses are- which in this case seems to be exactly what your looking for.

4. What in the world are you actually trying to do?

Why are you so hyper specific about how these flash card lingos get generated? What’s wrong with the other responses? Are you feeding the data into a subsequent system that is that rigid? Is it just for your own personal desire? Are you open to running the output through a lightweight system on your end, or are you only comfortable/capable of using the web chat interface? If you were doing this through API, you could so easily add regex processing/other rules onto the output, and likely very easily come up with a system of parsing the output exactly like you want (and GPT could generate the code for you, but you’ll have to setup the environment/process).


5. I'm a little confused now about what the outputs your getting are like and what the desired result is.

Are you trying to control the translation to be inaccurate? I mean for example, I don’t know what your translating, but “go walk” is a totally different translation than “to walk” or just “walk”. I mean in english obviously, and presumably from other languages as well, the differences between infinitives, etc… So what’s the inaccuracy in the result? Is it a mistranslation, or your trying to take what is an accurate translation and have it essentially formatted an “inaccurate way” or a way that “represents a part of the translation but not the entire translation”?


6. In your new prompt, I don't see anything about the operators "and" / "or" being mentioned. Did you just not share that info, or did you not include it in the prompt?

7. Lastly, the system your building in a way seems very cool and robust
  • if your trying to develop something for a wider audience beyond yourself, I’d highly recommend getting into the code side of things and spending much more time designing a backend system. Languages are different - getting identical results across multiple languages is sort of inaccurate in a basic sense to the differences between conceptual and semantic inherent differences between languages, especially when translating to English and attempting to reduce the translation to a metric that is not inherently representative of the nuances and inherent semantic concept present in the other languages. If you ARE trying to extract this data and use it in a real-world-application in the sense of actually “producing a product”, etc., I would say your going to need spend much more time on both a pre-processing and post-processing layer.

Example system setup if you were using a codebase pre-processing/post processing interface

For example you would set up something like this:

1. Frontend pre-processing 4. - system receives user input and runs either an in-house (i.e. python/regex/etc.) evaluation that says "what's the input language, what's the desired output language, does it easily match our desired formatting, or does it not match standard syntax) **perhaps also you are providing drop-down selectors and more clear field delineation for the input** such as:

User interface

  • Drop down for language
  • Drop down for question “type”
  • Fields (depending on question type dropdown) for the user to enter the data in the | this part of input | that part of input | final part of input | format, making your processing much easier and the prompt much more clear
  • Other fields/checkboxes/dropdowns etc. for making selections
  • Making fields required vs. optional for input…
  1. Send your prompt to GPT as the output from your pre-processing system
3. Backend post-processing - Take the output from the GPT response and route it through your regex processors like: - Are there operators that we don't like? Can we simply remove them? - Can we apply more regex or if/then/therefore statements and filter out data in a particular way through some kind of extraction? - Can we make another quick loop call to a mini-gpt model and ask for formatting with the next set of final refinement rules? - Etc...

So a multi-turn system would also work, and then finally after all that you would theoretically “have everything exactly how you want” and you would have also your input (already split into multiple fields/preprocessed), and now you have your output, all cleaned up, refined, exactly how you want it, and now you can save everything to a database, and then have a user interface for sending that database data into a flashcard-display system, select by language, randomly generate, show one side or the other, etc…


I’m enjoying the conversation. I’m also very very close (a few days away) from a testing stage of an “autopoietic” in house system of using the GPT. I.e. I’m looking for clearly structured project prompts that I can feed into the system, and the system should perform an indefinite number of looped API calls and structured data output and recursive input, and the final “output” to the user (probably will take 30 minutes? an hour? a day?) and several hundred API calls, but the output should be… a complete and working desktop or webapp that does everything - you get the result, and put in your own API key - and voila - all your dreams come true…

So if you were interested in submitting this as a free test case I’d be open to running it… but maybe that’s not the level your going for here… in any case thought I’d mention that potential to you.

1 Like

I had a chance to look at this more, and I see you have a lot of very specific things in here. I notice that LLMs tend to start “forgetting” instructions the more increasingly complicated the prompt gets. Also, LLMs respond best to prompts that resemble the training data, and although we don’t have access to that, OpenAI has some guidance as to how gpt-4.1 is trained. So, my goal was to condense the prompt by omitting examples and redundant instructions, and also to convert to a heading structure closer to what we see in OpenAI’s cookbook: GPT-4.1 Prompting Guide | OpenAI Cookbook

Here’s the prompt I’ve had most success with, based on the criteria and examples in your revised prompt. I also include user and assistant messages as an example to the LLM, a common technique called “one-shot training”, or “few-shots training” for multiple examples, to improve LLM accuracy. You can achieve this on the Playground by clicking “add message” in the bottom-left corner.

System
You are an expert Anki-card writer. Always output exactly one line of raw TSV in the following format:
[TERM]	[DEFINITION]	[EXAMPLE]

# Input format / invocation context

You will determine the intent of the user depending on the input. For example, the inclusion of tabs ("	") indicates that the input line should be copied as-is, spelling intact. Interpret all instances of double spaces ("  ") as tabs, making sure to transcribe them as such.

Other times, you will need to write the TSV line using context provided to you. See next section for details.

# Output format

**Term:**
- The term is supplied via user input.
- You will compress any questions or terms supplied in natural language into shorthand. Example: "What is the boiling point of water?" -> "water boiling point"
- If the term contains a copyright disclaimer, you will remove it.
- If the term contains double spaces ("  ") you will replace them with tabs ("	"). This also means you will advance to the next parameter, "definition."
- Preserve shorthand, and provide shorthand definitions for shorthand terms. Example: "planet moon dif" should remain "planet moon dif." This example is asking for the difference between a planet and moon, and the correct definition is "orbits star, orbits planet."

**Definition:**
- Always use shorthand.
- Pick no more than ONE meaning or answer. For words with multiple meanings, you will pick only one.
- Do not attempt to include multiple meanings or answers in the definition. Use context to pick the most logical interpretation.

**Example:**
- Your example should be in natural language, but still kept short.

# Notes

If the user ends their message with a double colon ("::") then you will produce 6 different lines on their provided topic.
User

weekday in

Assistant

weekday in Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday

These three messages remain static and are all part of the bigger prompt to the LLM. You can change the example or add more depending on your liking.

Screenshot of prompt with output

As far as improving beyond this goes - I think this is as far as you can get with prompting alone. If you’re integrating this with code, you can consider automating a lot of this, particularly the “double space” interpretation as a tab, and the “double colon” as an indication to output more (rather than prompting the LLM with info on this symbol on every run.)

You may also consider fine-tuning to increase accucy and reduce cost, but you’ll need to prepare a diverse dataset of hundreds (or possibly thousands) of high-quality examples.

Hope this helps! And having fun while learning is never a waste of time.

2 Likes