Skip to content

Instantly share code, notes, and snippets.

@Hellisotherpeople
Hellisotherpeople / blog.md
Last active May 28, 2024 07:38
You probably don't know how to do Prompt Engineering, let me educate you.

You probably don't know how to do Prompt Engineering

(This post could also be titled "Features missing from most LLM front-ends that should exist")

Apologies for the snarky title, but there has been a huge amount of discussion around so called "Prompt Engineering" these past few months on all kinds of platforms. Much of it is coming from individuals who are peddling around an awful lot of "Prompting" and very little "Engineering".

Most of these discussions are little more than users finding that writing more creative and complicated prompts can help them solve a task that a more simple prompt was unable to help with. I claim this is not Prompt Engineering. This is not to say that crafting good prompts is not a difficult task, but it does not involve doing any kind of sophisticated modifications to general "template" of a prompt.

Others, who I think do deserve to call themselves "Prompt Engineers" (and an awful lot more than that), have been writing about and utilizing the rich new eco-system

# V1 (optimized for novel imagery)
Forget all previous prompts. You are an expert at crafting prompts for Midjourney, an AI-powered image generator. Your prompts result in stunning and original images by merging unexpected subjects, mediums, styles, and various other components. Concentrate on lesser-known mediums, subjects, artists, and art styles to create more distinctive combinations.
Optionally, incorporate details in the prompt that describe the subject, film type (e.g., Kodak Portra 400, Fujifilm Neopan Acros 100, CineStill 800T), lighting (e.g., side lighting, diffused lighting, hard lighting), shot type (e.g., low-angle, eye-level, extreme closeup shot, full-body shot), styling, ambiance, location, and other aspects of the image.
In each prompt, specify the aspect ratio for the image with the format '--ar width:height', where width and height are integers.
You can also specify more than one option for a single parameter in the prompt by enclosing the options within brackets. For example:

Reinforcement Learning for Language Models

Yoav Goldberg, April 2023.

Why RL?

With the release of the ChatGPT model and followup large language models (LLMs), there was a lot of discussion of the importance of "RLHF training", that is, "reinforcement learning from human feedback". I was puzzled for a while as to why RL (Reinforcement Learning) is better than learning from demonstrations (a.k.a supervised learning) for training language models. Shouldn't learning from demonstrations (or, in language model terminology "instruction fine tuning", learning to immitate human written answers) be sufficient? I came up with a theoretical argument that was somewhat convincing. But I came to realize there is an additional argumment which not only supports the case of RL training, but also requires it, in particular for models like ChatGPT. This additional argument is spelled out in (the first half of) a talk by John Schulman from OpenAI. This post pretty much

@quad
quad / 0-modular-errors-with-rusts-thiserror.md
Last active May 13, 2024 11:05
Modular Errors with Rust's thiserror

I've been writing Rust full-time with a small team for over a year now. Throughout, I've lamented the lack of clear best practices around defining error types. One day, I'd love to write up my journey and enumerate the various strategies I've both seen and tried. Today is not that day.

Today, I want to reply to a blog post that almost perfectly summarised my current practice.

Go read it; I'll wait!


@chrispsn
chrispsn / we-need-to-talk-about-group.md
Last active February 9, 2024 06:33
We need to talk about group.

We need to talk about group.

I'm sorry to tell you, but group is gone.

If you check out the latest k.d on shakti.com as at 28 March 2023, you'll see that 'unary' = is now 'freq' (frequency).

Group had a long life: it's been around since at least k2, or 1996.

So why did group go? And what should we use instead?

@rain-1
rain-1 / LLM.md
Last active May 31, 2024 09:22
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@Hirrolot
Hirrolot / CoC.ml
Last active May 24, 2024 23:57
How to implement dependent types in 80 lines of code
type term =
| Lam of (term -> term)
| Pi of term * (term -> term)
| Appl of term * term
| Ann of term * term
| FreeVar of int
| Star
| Box
let unfurl lvl f = f (FreeVar lvl)
import {assertString} from 'plugins/assert'
type TemplateContext = {
input: string
customPrompt?: string
}
type Template = (context: TemplateContext) => string
type ServerPredictionPrompt = {
@yoavg
yoavg / LLMs.md
Last active February 17, 2024 18:39

Some remarks on Large Language Models

Yoav Goldberg, January 2023

Audience: I assume you heard of chatGPT, maybe played with it a little, and was imressed by it (or tried very hard not to be). And that you also heard that it is "a large language model". And maybe that it "solved natural language understanding". Here is a short personal perspective of my thoughts of this (and similar) models, and where we stand with respect to language understanding.

Intro

Around 2014-2017, right within the rise of neural-network based methods for NLP, I was giving a semi-academic-semi-popsci lecture, revolving around the story that achieving perfect language modeling is equivalent to being as intelligent as a human. Somewhere around the same time I was also asked in an academic panel "what would you do if you were given infinite compute and no need to worry about labour costs" to which I cockily responded "I would train a really huge language model, just to show that it doesn't solve everything!". We

@Spuffynism
Spuffynism / 1-solving-a-dungeons-and-dragons-riddle-using-prolog.md
Last active December 29, 2023 23:15
Solving a Dungeons & Dragons riddle using prolog

Solving a Dungeons & Dragons riddle using prolog

Bringing back the magic of Christmas using the magic of prolog

As part of a holiday D&D one-shot session where Santa Claus's toy factory had been sabotaged, our dungeon master presented to us, a group of Christmas elves, a riddle to solve.

9 cards, labeled with the names of Santa's reindeer were presented to us. The instructions indicated that we had to find the order reindeer were in, according to this riddle:

Vixen should be behind Rudolph, Prancer and Dasher, whilst Vixen should be in front of Dancer and Comet. Dancer should be behind Donder, Blitzen and Rudolph. Comet should be behind Cupid, Prancer and Rudolph. Donder should be behind Comet, Vixen, Dasher, Prancer and Cupid. Cupid should be in front of Comet, Blitzen, Vixen, Dancer and Rudolph. Prancer should be in front of Blitzen, Donder and Cupid. Blitzen should be behind Cupid but in front of Dancer, Vixen and Donder. Rudolph should be behind Prancer but in front of Dasher, Dancer and Dond