Studenten gesucht
/**
* Active Inference Recruitment Script v1.0
*
* Target: CS Students
* Required Knowledge: TypeScript, FEP, EFE, Active Inference
*
* To proceed: Decode the output of infer()
*
* u/author Project AIC-AI-Lab
*/
interface GenerativeModel {
prior: (belief: BeliefState) => number;
likelihood: (observation: number[], belief: BeliefState) => number;
transition: (belief: BeliefState, action: Action) => BeliefState;
}
interface BeliefState {
mu: number[]; // expected states
sigma: number[]; // uncertainty
activeInferences: number;
}
interface Action {
type: 'explore' | 'exploit' | 'minimize_surprise';
parameters: Record<string, number>;
}
// ═══════════════════════════════════════════════════════════════════════
// FEP: Free Energy Principle
// F = -log p(θ) + KL(q(θ) || p(θ|o))
// ═══════════════════════════════════════════════════════════════════════
function computeFreeEnergy(
belief: BeliefState,
observations: number[],
model: GenerativeModel
): number {
const prior = model.prior(belief);
const surprise = computeNegativeLogLikelihood(observations, belief, model);
// F = E_q[log q(θ) - log p(θ, o)]
// Minimizing free energy = minimizing surprise while staying close to prior
return -(Math.log(prior) + surprise);
}
function computeNegativeLogLikelihood(
observations: number[],
belief: BeliefState,
model: GenerativeModel
): number {
const likelihood = model.likelihood(observations, belief);
return -Math.log(likelihood + 1e-10); // epsilon for numerical stability
}
// ═══════════════════════════════════════════════════════════════════════
// EFE: Expected Free Energy
// G(π) = E_q[log p(o) + β · KL(q(θ) || p(θ|o,π))]
// ═══════════════════════════════════════════════════════════════════════
function computeExpectedFreeEnergy(
policy: Action,
currentBelief: BeliefState,
model: GenerativeModel,
beta: number = 1.0
): number {
let totalEFE = 0;
const numSamples = 1000;
for (let i = 0; i < numSamples; i++) {
// Sample observation from generative model
const predictedObservation = sampleObservation(currentBelief, model);
// Compute log probability of observation (epistemic value)
const logProb = Math.log(model.likelihood([predictedObservation], currentBelief) + 1e-10);
// Compute KL divergence for pragmatic value
const predictedBelief = model.transition(currentBelief, policy);
const klDivergence = computeKL(currentBelief, predictedBelief);
// G = -(log p(o)) + β * KL
totalEFE += -(logProb) + beta * klDivergence;
}
return totalEFE / numSamples;
}
function computeKL(beliefA: BeliefState, beliefB: BeliefState): number {
// KL(q||p) = sum q * log(q/p)
const muA = beliefA.mu;
const muB = beliefB.mu;
let kl = 0;
for (let i = 0; i < muA.length; i++) {
if (muA[i] > 0 && muB[i] > 0) {
kl += muA[i] * Math.log(muA[i] / muB[i]);
}
}
return kl;
}
// ═══════════════════════════════════════════════════════════════════════
// ACTIVE INFERENCE CORE
// Agent selects action that minimizes expected free energy
// ═══════════════════════════════════════════════════════════════════════
function selectAction(
beliefs: BeliefState,
model: GenerativeModel,
availablePolicies: Action[]
): Action {
let bestAction = availablePolicies[0];
let minEFE = Infinity;
for (const policy of availablePolicies) {
const gpi = computeExpectedFreeEnergy(policy, beliefs, model);
if (gpi < minEFE) {
minEFE = gpi;
bestAction = policy;
}
}
return bestAction;
}
// ═══════════════════════════════════════════════════════════════════════
// INFERENCE LOOP - The Heart of the Agent
// ═══════════════════════════════════════════════════════════════════════
async function infer(
initialBelief: BeliefState,
observations: number[],
model: GenerativeModel,
policies: Action[]
): Promise<string> {
// Step 1: Update beliefs based on new observations (variational inference)
const updatedBelief = await variationalUpdate(initialBelief, observations, model);
// Step 2: Select action that minimizes EFE
const action = selectAction(updatedBelief, model, policies);
// Step 3: Execute action and get new observation
const newObservation = await executeAction(action, observations);
// Step 4: Compute free energy to validate
const freeEnergy = computeFreeEnergy(updatedBelief, newObservation, model);
// Step 5: If free energy is below threshold, agent is "happy"
// Return encoded result
return encodeResult(updatedBelief, freeEnergy);
}
async function variationalUpdate(
belief: BeliefState,
observations: number[],
model: GenerativeModel
): Promise<BeliefState> {
// Mean-field approximation for tractable variational inference
// q(θ) = prod q_i(θ_i)
const lr = 0.01;
let currentBelief = { ...belief };
for (let iteration = 0; iteration < 100; iteration++) {
const gradF = computeFreeEnergyGradient(currentBelief, observations, model);
currentBelief.mu = currentBelief.mu.map(
(m, i) => m - lr * gradF.mu[i]
);
currentBelief.sigma = currentBelief.sigma.map(
(s, i) => Math.max(0.01, s - lr * gradF.sigma[i])
);
}
return currentBelief;
}
function computeFreeEnergyGradient(
belief: BeliefState,
observations: number[],
model: GenerativeModel
): { mu: number[]; sigma: number[] } {
const epsilon = 1e-5;
const gradMu: number[] = [];
const gradSigma: number[] = [];
for (let i = 0; i < belief.mu.length; i++) {
const fPlus = computeFreeEnergy(
{ ...belief, mu: belief.mu.map((m, j) => j === i ? m + epsilon : m) },
observations,
model
);
const fMinus = computeFreeEnergy(
{ ...belief, mu: belief.mu.map((m, j) => j === i ? m - epsilon : m) },
observations,
model
);
gradMu.push((fPlus - fMinus) / (2 * epsilon));
const sPlus = computeFreeEnergy(
{ ...belief, sigma: belief.sigma.map((s, j) => j === i ? s + epsilon : s) },
observations,
model
);
const sMinus = computeFreeEnergy(
{ ...belief, sigma: belief.sigma.map((s, j) => j === i ? s - epsilon : s) },
observations,
model
);
gradSigma.push((sPlus - sMinus) / (2 * epsilon));
}
return { mu: gradMu, sigma: gradSigma };
}
function encodeResult(belief: BeliefState, freeEnergy: number): string {
// Extract the "hidden" value from the belief state
// The agent's identity is encoded in mu[0]
const identity = Math.round(belief.mu[0] * 1000) % 10000;
const energyCode = Math.round(freeEnergy * 100);
// Decode: {identity}-{energyCode}
// Convert to Discord invite format
return `https://discord.gg/gTjb5ZPrCY;
}
async function executeAction(action: Action, currentObs: number[]): Promise<number[]> {
// Simplified: just add noise to simulate world interaction
return currentObs.map(o => o + (Math.random() - 0.5) * 0.1);
}
function sampleObservation(belief: BeliefState, model: GenerativeModel): number {
// Sample from the generative model's predicted observations
const mu = belief.mu[0] || 0;
const sigma = belief.sigma[0] || 1;
return mu + (Math.random() - 0.5) * sigma;
}
// ═══════════════════════════════════════════════════════════════════════
// BOOTSTRAP & ENTRY POINT
// ═══════════════════════════════════════════════════════════════════════
const bootstrapModel: GenerativeModel = {
prior: (b) => Math.exp(-0.5 * b.mu.reduce((s, m) => s + m * m, 0)),
likelihood: (obs, b) => Math.exp(-0.5 * obs.reduce((s, o, i) => {
const pred = b.mu[i] || 0;
return s + (o - pred) ** 2;
}, 0)),
transition: (b, a) => ({
mu: b.mu.map(m => m + (a.type === 'explore' ? 0.1 : 0.01)),
sigma: b.sigma.map(s => s * (a.type === 'exploit' ? 0.9 : 1.0)),
activeInferences: b.activeInferences + 1
})
};
const initialBelief: BeliefState = {
mu: [42, 137, 896],
sigma: [1.0, 1.0, 1.0],
activeInferences: 0
};
const policies: Action[] = [
{ type: 'explore', parameters: { temperature: 1.0 } },
{ type: 'exploit', parameters: { confidence: 0.8 } },
{ type: 'minimize_surprise', parameters: { tolerance: 0.01 } }
];
// RUN THE AGENT
// If you understand this code, you understand what we're building.
// The output is your invitation.
const result = await infer(initialBelief, [0.5, 0.3, 0.8], bootstrapModel, policies);
console.log(`
╔══════════════════════════════════════════════════════════════════╗
║ ║
║ If you're reading this, you've successfully parsed the ║
║ Active Inference recruitment script. ║
║ ║
║ Result: ${result.padEnd(50)}║
║ ║
║ This is not a scam. This is real. ║
║ ║
╚══════════════════════════════════════════════════════════════════╝
`);
Für alle ohne IT Studium, auch Studenten der Psychologie, Soziologie, Psychiatrie und Neurologie wären gern gesehen. Falls ihr also noch nach einem Thema für Bachelor oder Master sucht meldet euch. Auch für jene die den Wunsch hegen zu promovieren könnte es interessant sein. Für nähere Infos einfach PN schreiben oder direkt über die Website Kontakt aufnehmen.
Posted Jun 5, 2026, 7:55 PM UTC