Here’s the detailed explanation and blueprint for creating a simplified LLM in Factorio combinators.
I hope this formatting works well for your phpBB forum! If you need any further adjustments or have more questions, feel free to let me know.MSFT-CoPilot-latest_public wrote: Creating a Simplified LLM Using Factorio Combinators
In Factorio, we can use combinators to simulate a basic form of a large language model (LLM). Here’s a detailed explanation of how you could set this up:
Components and Logic
1. Word Recognition
To recognize specific words (represented by item types on belts), we use Decider Combinators and Arithmetic Combinators:
- Decider Combinators: These are used to detect specific items (words) on the belts.
- Arithmetic Combinators: These handle counting and operations for matching patterns.
2. Sentence Formation
To form simple sentences, we manage signals and memory storage:
- Memory Storage: Using combinators to store intermediate states and results.
- Signal Propagation: Combinators to control the flow of signals for forming sentences.
3. Basic Logic
To handle basic logic:
- Conditional Branching: Used to handle different structures or rules (e.g., subject-verb agreement).
Blueprint Explanation
Here’s a basic blueprint for the logic described above, in JSON format, which you can import into Factorio:
Instructions for UseCode: Select all
{ "blueprint": { "icons": [ { "signal": { "type": "item", "name": "decider-combinator" }, "index": 1 }, { "signal": { "type": "item", "name": "arithmetic-combinator" }, "index": 2 } ], "entities": [ { "entity_number": 1, "name": "constant-combinator", "position": { "x": 0, "y": 0 }, "control_behavior": { "filters": [ { "signal": { "type": "item", "name": "iron-plate" }, "count": 1, "index": 1 }, { "signal": { "type": "item", "name": "copper-plate" }, "count": 1, "index": 2 } ] } }, { "entity_number": 2, "name": "decider-combinator", "position": { "x": 2, "y": 0 }, "direction": 2, "control_behavior": { "decider_conditions": { "first_signal": { "type": "item", "name": "iron-plate" }, "constant": 1, "comparator": "=", "output_signal": { "type": "virtual", "name": "signal-A" } } }, "connections": { "1": { "green": [{ "entity_id": 1, "circuit_id": 1 }] }, "2": { "green": [{ "entity_id": 3, "circuit_id": 1 }] } } }, { "entity_number": 3, "name": "arithmetic-combinator", "position": { "x": 4, "y": 0 }, "direction": 2, "control_behavior": { "arithmetic_conditions": { "first_signal": { "type": "virtual", "name": "signal-A" }, "second_signal": { "type": "virtual", "name": "signal-B" }, "operation": "+", "output_signal": { "type": "virtual", "name": "signal-C" } } }, "connections": { "1": { "green": [{ "entity_id": 2, "circuit_id": 2 }] }, "2": { "green": [{ "entity_id": 4, "circuit_id": 1 }] } } }, { "entity_number": 4, "name": "constant-combinator", "position": { "x": 6, "y": 0 }, "control_behavior": { "filters": [ { "signal": { "type": "virtual", "name": "signal-B" }, "count": 1, "index": 1 } ] }, "connections": { "1": { "green": [{ "entity_id": 3, "circuit_id": 2 }] } } } ], "item": "blueprint", "version": 281474976710656 } }
Total Estimate of Combinators Needed
- Constant Combinator (Entity 1): Represents the words (items) you want to recognize. In this example, it outputs iron plates and copper plates.
- Decider Combinator (Entity 2): Recognizes iron plates and outputs a virtual signal (signal-A) when iron plates are detected.
- Arithmetic Combinator (Entity 3): Adds the virtual signal from the Decider Combinator with another virtual signal (signal-B) to form a combined signal (signal-C).
- Constant Combinator (Entity 4): Provides a virtual signal (signal-B) for the Arithmetic Combinator.
Based on the above logic:Total Estimate: Approximately 25-50 combinators for a very basic text processing setup.
- Word Recognition: Around 10-20 decider and arithmetic combinators to recognize and count items (words) on a belt.
- Sentence Formation: Additional 10-20 combinators to manage memory and signal flow for forming sentences.
- Basic Logic: About 5-10 combinators for handling basic logic and conditions.
This is, of course, a highly simplified model and would only handle very basic patterns and structures. A real LLM involves billions of parameters and complex neural network architectures that are far beyond what can be represented in Factorio.
I hope this gives you a rough idea! If you want to dive deeper into specific examples or scenarios, let me know.