TECHNOLOGY

Carbon consciousness and the mechanics of thought chaining

By Luc Pettett on
Carbon consciousness and the mechanics of thought chaining

Consciousness arises in the human brain from underlying unconscious processes that constantly link memories, experiences, and ideas together. As cognitive scientist Stanislas Dehaene explains, consciousness allows us to maintain information over an extended time in our working memory. Even when we move our attention elsewhere, thoughts continue reverberating in the global neuronal workspace of the brain.

This phenomenon demonstrates how consciousness enables connections between memories and experiences that evade deliberate search. Our subjective awareness arises from underlying unconscious processes that constantly chain together information outside the spotlight of attention. Understanding these carbon-based mechanisms provides a framework for evaluating artificial systems that attempt to replicate similar capabilities.

Reinforcement learning and carbon-based cognition

Reinforcement learning (RL) takes inspiration from behavioral psychology and neuroscience research on how humans and animals learn from experience. An agent interacts with an environment, receiving positive or negative feedback for its actions. Over time, the agent learns to take actions that maximize cumulative reward.

RL algorithms like Q-learning and policy gradients are inspired by evidence showing how human and animal behavior is shaped through reward feedback. Dopaminergic neurons that encode reward prediction errors are analogous to the reward signals used to update agent policies. While differences exist, RL replicates key neurocognitive learning processes in simplified form.

Large language models like GPT-4 exhibit some basic RL abilities. When prompted appropriately, they can learn simple behaviors over multiple iterations through prompt chaining. This technique, when combined with pre-trained models and careful orchestration around the process of chaining, allows a model to enhance itself by building connections.

Prompt chaining: a practical demonstration

Prompt chaining can solve problems that can’t be solved with direct requests. Consider the task of writing a children’s book in the style of Hairy Maclary. A direct request produces acceptable but unremarkable results. The approach below involves asking AI to write a book, then looping 10 times—asking AI for a prompt suggestion to edit the book and feeding the result of this suggestion into AI again, alongside the current working draft.

import openai

openai.api_key = "YOUR_OPEN_AI_KEY"

def get_response(prompt):
    messages = [
        {"role": "system", "content": "You're a skilled childrens book author that writes 3 page books in the style of Hairy McLarey."},
        {"role": "user", "content": prompt}
    ]
    
    response = openai.ChatCompletion.create(
        model="gpt-4",
        messages=messages,
        temperature=0.5,
    )
    
    return response["choices"][0]["message"]["content"]

prompt = "Please write a story:"
draftBook = get_response(prompt)

print("--First Draft--")
print(draftBook)

for i in range(3):
    prompt = "Please provide a singular, targeted improvement to this book (rather than open-ended edits). Draft Book:" + draftBook
    new_prompt = get_response(prompt)
    
    print("--Self Improving " + str(i+1) + "--")
    print(new_prompt)
    
    prompt = "Re-write the book in full form with the following suggestion: " + new_prompt + "\n\nBook:\n" + draftBook
    draftBook = get_response(prompt)

print("--Final Book--")
print(draftBook)