Introduction
This project attempts to approach the problem of consciousness through computational modeling. Based on Baars' Global Workspace Theory, we use Racket's macro system and functional programming paradigm to construct a simplified model of information competition and broadcasting.
Core Concept
The system's core mechanism is a "global workspace"—different functional modules can broadcast information to this space, and through competitive selection, determine attention allocation:
(define (broadcast workspace message)
(send workspace publish message))
(define (attend-to workspace callback)
(send workspace subscribe callback))
(broadcast global-workspace
(make-message 'sensory "red object detected"))
(attend-to global-workspace
(lambda (msg)
(when (eq? (message-type msg) 'sensory)
(process-sensory msg))))Theoretical Foundation
Global Workspace Theory
Baars' Global Workspace Theory posits that consciousness is an information integration mechanism. Multiple parallel specialized processing modules compete to propagate information to the global workspace, making it accessible to other modules.
Computational Model Mapping
| Theory Concept | Implementation |
|---|---|
| Specialized modules | Independent Racket threads/coroutines |
| Global workspace | Publish/subscribe message bus |
| Competition | Priority-based scheduler |
| Attention | Single active broadcast source |
Implementation Details
Publish/Subscribe Mechanism
(struct workspace (subscribers lock) #:mutable)
(define (make-workspace)
(workspace '() (make-semaphore 1)))
(define (publish ws message)
(call-with-semaphore (workspace-lock ws)
(lambda ()
(for ([sub (workspace-subscribers ws)])
((cdr sub) message)))))
(define (subscribe ws key callback)
(call-with-semaphore (workspace-lock ws)
(lambda ()
(set-workspace-subscribers!
ws
(cons (cons key callback)
(workspace-subscribers ws))))))Competition Mechanism
(define (compete workspace messages)
(define ranked
(sort messages
(lambda (a b)
(> (message-priority a)
(message-priority b)))))
(if (not (null? ranked))
(publish workspace (car ranked))
(publish workspace (make-message 'idle "no input"))))Exploratory Conclusions
Through this simple computational model, we observed:
- Information Integration: Information from multiple independent modules can be integrated through broadcasting
- Attention Switching: Competition mechanism can simulate dynamic attention allocation
- Emergent Behavior: Simple rules can produce complex system behavior
Limitations and Reflections
Theoretical Limitations
- This model is a gross simplification of GWT, ignoring neuroscience details
- Does not address the subjective experience (qualia) of consciousness
- Lacks learning and adaptation mechanisms
Technical Limitations
- Single-machine implementation, no distributed scaling
- No persistent state
- Lacks performance optimization
Project Status
This project serves as a theoretical exploratory programming exercise, aiming to provide an actionable modeling approach from a computational perspective for consciousness research. The project is archived and no longer actively developed.
Related Links
- GitHub Repository(opens in a new tab)
- Baars, B. J. (2005). Global Workspace Theory of Consciousness(opens in a new tab)
- Racket Official Website(opens in a new tab)
Last updated: 2025-11-26