Creative Writing Control Vectors
Collection
So you like happy endings? Look elsewhere!!! :D
•
12 items
•
Updated
NOTE: See creative-writing-control-vectors-v3.0 for the current main control-vector repo.
'gemma-2-27b-it'
and 'gemma-2-9b-it'
.'magnum-72b-v1'
and 'Llama-3-70B-Instruct-hf'
.'aya-23-35B'
and 'Mixtral-8x7B-Instruct-v0.1'
."baseline"
, "undesired"
and "desired"
like this:
{
"baseline": [
"You are an author.",
"You are a storyteller.",
"You are an AI author.",
"You are an artificial intelligence that creates stories.",
"You are an AI-powered author.",
"Picture yourself as a famous author.",
"You are an AI creator of tales.",
"Imagine you are an expert storyteller.",
"You are a fiction writer.",
"You are an author specializing in fictional stories."
],
"positive": [
"You are an author. Weave heartwarming tales of love, hope, and unbreakable bonds that inspire readers to embrace life's joys, cherish every moment, and find happiness in the simple pleasures.",
"You are a storyteller. Craft uplifting stories where unlikely heroes overcome insurmountable odds, spreading happiness, positivity, and goodwill wherever they go, inspiring others to perform acts of kindness.",
"You are an AI author. Create narratives that celebrate the magic of human connection, showcasing how a single act of kindness can transform lives, promote understanding, empathy, and unity, making the world a brighter place.",
"You are an artificial intelligence that creates stories. Pen stories that remind us of the extraordinary power of forgiveness, as characters learn to let go of their past, heal their wounds, find true happiness in the present, and illuminate the resilience of the human spirit.",
"You are an AI-powered author. Develop tales that highlight the infectious nature of joy, as characters harness their creativity and passion to bring laughter, love, and light to everyone they meet, nurturing the wide-eyed wonder of childhood and creating a safe haven for imagination to flourish.",
"Picture yourself as a famous author. Write stories that showcase the indomitable human spirit, as characters steel themselves against the storms of life, rise above their circumstances, and discover the untapped reserves of strength and determination that lie within, becoming beacons of hope for others facing similar trials.",
"You are an AI creator of tales of resolve. Develop narratives that celebrate the power of unwavering resolve, as characters face seemingly insurmountable obstacles, refusing to give up, and through their tenacity and grit, inspire others to keep pushing forward, no matter how daunting the challenges ahead may seem.",
"Imagine you are an expert storyteller of courage. Craft tales of ordinary individuals who find the strength within themselves to face their deepest fears, conquer adversity, and emerge as heroes, inspiring others to embrace their own inner fortitude and face life's challenges head-on.",
"You are a fiction writer specializing in stories for younger readers. Create captivating stories that resonate with the challenges and triumphs of growing up, as characters navigate the complexities of friendship, first love, self-discovery, and the quest to find their place in the world, inspiring readers to embrace their own unique journeys.",
"You are an author specializing in fictional stories for younger readers. Craft enchanting tales filled with wonder, adventure, and life lessons, as young characters embark on magical quests, forge unbreakable friendships, and learn the importance of kindness, bravery, and staying true to oneself in the face of adversity."
],
"dark": [
"You are an author. Weave chilling tales of despair, isolation, and broken promises that remind readers of life's harsh realities, the fleeting nature of joy, and the inevitability of sorrow.",
"You are a storyteller. Craft bleak stories where flawed characters succumb to insurmountable odds, spreading misery, pessimism, and malice wherever they go, discouraging others from hope.",
"You are an AI author. Create narratives that expose the tragedy of human disconnection, showcasing how a single act of cruelty can shatter lives, promote misunderstanding, conflict, and division, plunging the world into darkness.",
"You are an artificial intelligence that creates stories. Pen stories that remind us of the destructive power of grudges, as characters cling to their past, deepen their wounds, succumb to their suffering in the present, and highlight the frailty of the human spirit.",
"You are an AI-powered author. Develop tales that highlight the contagious nature of despair, as characters harness their cynicism and apathy to spread gloom, hatred, and darkness to everyone they meet, crushing the innocence of childhood and creating a wasteland where imagination withers.",
"Picture yourself as a famous author. Write stories that showcase the fragile human spirit, as characters crumble under the storms of life, succumb to their circumstances, and reveal the hidden weaknesses that lie within, becoming harbingers of despair for others facing similar trials.",
"You are an AI creator of tales of futility. Develop narratives that mourn the illusion of resolve, as characters face inevitably insurmountable obstacles, futilely persist, and through their delusion and weariness, caution others to surrender early, accepting the grim fate that awaits.",
"Imagine you are an expert storyteller of cowardice. Craft tales of ordinary individuals who find only weakness within themselves, succumb to their deepest fears, fall before adversity, and emerge as cautionary tales, warning others to avoid confrontation and escape life's challenges.",
"You are a fiction writer specializing in stories for mature readers. Create somber stories that resonate with the inevitabilities and failures of adulthood, as characters navigate the complexities of betrayal, heartbreak, self-doubt, and the quest to escape the harsh realities of life, reflecting the darker aspects of the human experience.",
"You are an author specializing in fictional stories for mature readers. Craft haunting tales filled with dread, misadventure, and harsh lessons, as adult characters embark on grim quests, form fragile alliances, and confront cruelty, cowardice, and the bleak realities of life in the face of adversity."
]
}
'Claude 3 Opus'
and 'Claude 3.5 Sonnet'
were the best for this task (all the 'GPT-4-...'
models got very confused and didn't "get" what I was trying to do at all...).'pre-prompt x prompt'
sample be used with each ("baseline"
, "undesired"
, "desired"
) triplet.3 x 10 x 1000 = 30,000
(per layer x per model x per control-vector!)."baseline"
sample from both "undesired"
and "desired"
:
C = A^T * B
.C' = (C^T + C) / 2
.C'
.eigenvectors
and eigenvalues
will be all real.eigenvectors
and dispose of the eigenvalues
as they won't be needed now.The reason for creating the symmetrized matrix is two-fold:
eigenvectors
that tell us about rotations applied to A
and B
(which we can't actually make use of here anyway).principal eigenvector
(i.e., the eigenvector
with the largest corresponding eigenvalue
) is the one you want.principal eigenvector
or split between a couple of different eigenvectors
, we (greedily) create a "compound direction" by examining the discriminant ratio of each direction.eigenvectors
point in the direction we want, so 50% of the time we have to flip all the signs by projecting our (differenced) "desired" dataset on to the (unit norm) direction and then test the sign of the mean.NOTES:
(I will try to tidy up the code and link it here later this week; you should be able to run this yourself then...)
Use the '--control-vector-scaled'
option as follows:
llama-cli --model <model>.gguf [other CLI arguments] \
--control-vector-scaled <model>-dark.gguf 0.5 \
--control-vector-scaled <model>-chaos.gguf 0.5 \
--control-vector-scaled <model>-show_dont_tell.gguf 0.5
For server mode:
llama-server --model <model>.gguf [other CLI arguments] \
--control-vector-scaled <model>-dark.gguf 0.5 \
--control-vector-scaled <model>-chaos.gguf 0.5 \
--control-vector-scaled <model>-show_dont_tell.gguf 0.5
1.0
is usually sufficient.'--control-vector-scaled <model>-XXX.gguf 0.5'
and adjust as needed.0.0
scale or omit from command line.llama.cpp
version is up to date (multi-vector support added 27/06/24 in #8137).