Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -73,52 +73,212 @@ Comparison representing 100,000 tokens of corpus knowledge:
|
|
| 73 |
- **Graph state memory**: **2.61 MB** (VLCM) β **19,134.6x memory compression**
|
| 74 |
- **Generation FLOPs per query**: ~8.19 Trillion FLOPs vs. **~7.66 Million FLOPs** (1,000,000x savings)
|
| 75 |
|
| 76 |
-
### 4.
|
| 77 |
-
We run an end-to-end autonomous coding test using the local `qwen2.5-coder:3b` model to evaluate the coding performance:
|
| 78 |
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
* **
|
| 83 |
-
* **
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
|
| 85 |
-
#### Generated Python Code Example:
|
| 86 |
```python
|
|
|
|
|
|
|
| 87 |
def fibonacci(n):
|
| 88 |
-
|
| 89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
|
| 91 |
-
|
| 92 |
for i in range(2, n):
|
| 93 |
next_fib = fib_sequence[i-1] + fib_sequence[i-2]
|
| 94 |
fib_sequence.append(next_fib)
|
| 95 |
|
| 96 |
return fib_sequence
|
| 97 |
|
| 98 |
-
# Main block
|
| 99 |
if __name__ == "__main__":
|
| 100 |
n = 10
|
| 101 |
-
|
| 102 |
-
|
|
|
|
|
|
|
|
|
|
| 103 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
|
| 110 |
-
|
| 111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
|
| 123 |
---
|
| 124 |
|
|
|
|
| 73 |
- **Graph state memory**: **2.61 MB** (VLCM) β **19,134.6x memory compression**
|
| 74 |
- **Generation FLOPs per query**: ~8.19 Trillion FLOPs vs. **~7.66 Million FLOPs** (1,000,000x savings)
|
| 75 |
|
| 76 |
+
### 4. End-to-End Stress Test: 100,000 Concepts & Actual Code Generation
|
|
|
|
| 77 |
|
| 78 |
+
We stress-tested the performance, memory footprint, and reliability of the scaled symbolic reasoning engine using a **100,001-node coding concept graph with 1.2 Million directed edges**, paired with the local **Qwen 2.5 Coder 3B** model (`qwen2.5-coder:3b`) and a multi-language subprocess execution sandbox.
|
| 79 |
+
|
| 80 |
+
#### π Stress Test Performance & Memory Metrics:
|
| 81 |
+
* **Graph Sizing**: **100,001 nodes** and **1,200,000 directed edges**
|
| 82 |
+
* **Graph Load Time**: **14.58 seconds** (deserializing and building the in-memory graph structure)
|
| 83 |
+
* **RAM Memory Footprint**: **1,501.59 MB** (approx. 1.50 GB)
|
| 84 |
+
* **Symbolic Traversal Latency (5-hop Beam Search)**: **121.81 ms** (average over 50 runs, highly optimized via pre-calculated activation mappings)
|
| 85 |
+
* **Average Code Generation Time**: **8.94 seconds** per task (System 1 inference)
|
| 86 |
+
* **Sandbox Code Execution Time**: **0.41 seconds** (System 2 sandbox execution)
|
| 87 |
+
* **Sandbox Compilation/Execution Success Rate**: **100.0%** (5 out of 5 tasks successfully compiled and passed on the first attempt)
|
| 88 |
+
|
| 89 |
+
---
|
| 90 |
+
|
| 91 |
+
#### π» Multi-Language Code Generation & Sandbox Results
|
| 92 |
+
|
| 93 |
+
We ran 5 distinct coding tasks across Python and JavaScript, enforcing strict concept planning paths to test compliance, syntax validity, and execution outcomes.
|
| 94 |
+
|
| 95 |
+
````carousel
|
| 96 |
+
### π Task 1: Fibonacci Sequence (Python)
|
| 97 |
+
* **Prompt**: *"Write a Python function fibonacci(n) that returns the first n Fibonacci numbers. In the main block, call this function with n=10, print the result, and do not use any interactive input() calls."*
|
| 98 |
+
* **GNN Concept Path**: `Array Allocation in Python` β `Array Execution in Python` β `Array Optimization in Python`
|
| 99 |
+
* **Generation Time**: 10.99 seconds
|
| 100 |
+
* **Sandbox Output**: `The first 10 Fibonacci numbers are: [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]`
|
| 101 |
|
|
|
|
| 102 |
```python
|
| 103 |
+
# Fibonacci sequence generator in Python
|
| 104 |
+
|
| 105 |
def fibonacci(n):
|
| 106 |
+
'''
|
| 107 |
+
Generate the first n Fibonacci numbers.
|
| 108 |
+
|
| 109 |
+
Parameters:
|
| 110 |
+
n (int): The number of Fibonacci numbers to generate.
|
| 111 |
+
|
| 112 |
+
Returns:
|
| 113 |
+
list: A list containing the first n Fibonacci numbers.
|
| 114 |
+
'''
|
| 115 |
+
if n <= 0:
|
| 116 |
+
return []
|
| 117 |
+
elif n == 1:
|
| 118 |
+
return [0]
|
| 119 |
|
| 120 |
+
fib_sequence = [0, 1]
|
| 121 |
for i in range(2, n):
|
| 122 |
next_fib = fib_sequence[i-1] + fib_sequence[i-2]
|
| 123 |
fib_sequence.append(next_fib)
|
| 124 |
|
| 125 |
return fib_sequence
|
| 126 |
|
| 127 |
+
# Main block to test the fibonacci function
|
| 128 |
if __name__ == "__main__":
|
| 129 |
n = 10
|
| 130 |
+
try:
|
| 131 |
+
result = fibonacci(n)
|
| 132 |
+
print(f"The first {n} Fibonacci numbers are: {result}")
|
| 133 |
+
except Exception as e:
|
| 134 |
+
print(f"An error occurred: {e}")
|
| 135 |
```
|
| 136 |
+
<!-- slide -->
|
| 137 |
+
### π Task 2: Greatest Common Divisor (Python)
|
| 138 |
+
* **Prompt**: *"Write a Python function calculate_gcd(a, b) that computes the greatest common divisor using the Euclidean algorithm. Test it with inputs a=48 and b=18, print the result, and do not use interactive input() calls."*
|
| 139 |
+
* **GNN Concept Path**: `Variable Normalization in Python` β `Variable Execution in Python` β `Variable Optimization in Python`
|
| 140 |
+
* **Generation Time**: 6.26 seconds
|
| 141 |
+
* **Sandbox Output**: `The greatest common divisor of 48 and 18 is: 6`
|
| 142 |
|
| 143 |
+
```python
|
| 144 |
+
# Function to calculate the greatest common divisor using the Euclidean algorithm
|
| 145 |
+
def calculate_gcd(a, b):
|
| 146 |
+
# Ensure both numbers are positive
|
| 147 |
+
a = abs(a)
|
| 148 |
+
b = abs(b)
|
| 149 |
+
|
| 150 |
+
# Use the Euclidean algorithm to find GCD
|
| 151 |
+
while b:
|
| 152 |
+
a, b = b, a % b
|
| 153 |
+
|
| 154 |
+
return a
|
| 155 |
+
|
| 156 |
+
# Main block with test data
|
| 157 |
+
if __name__ == "__main__":
|
| 158 |
+
a = 48
|
| 159 |
+
b = 18
|
| 160 |
+
try:
|
| 161 |
+
result = calculate_gcd(a, b)
|
| 162 |
+
print(f"The greatest common divisor of {a} and {b} is: {result}")
|
| 163 |
+
except Exception as e:
|
| 164 |
+
print(f"An error occurred: {e}")
|
| 165 |
```
|
| 166 |
+
<!-- slide -->
|
| 167 |
+
### π Task 3: Matrix Transpose (Python)
|
| 168 |
+
* **Prompt**: *"Write a Python function transpose(matrix) that transposes a 2D list (matrix) of size 3x3. Test it with matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]], print the transposed matrix, and do not use interactive input() calls."*
|
| 169 |
+
* **GNN Concept Path**: `Matrix Normalization in Python` β `Matrix Execution in Python` β `Matrix Optimization in Python`
|
| 170 |
+
* **Generation Time**: 8.75 seconds
|
| 171 |
+
* **Sandbox Output**:
|
| 172 |
+
```text
|
| 173 |
+
Original Matrix:
|
| 174 |
+
[1, 2, 3]
|
| 175 |
+
[4, 5, 6]
|
| 176 |
+
[7, 8, 9]
|
| 177 |
+
|
| 178 |
+
Transposed Matrix:
|
| 179 |
+
[1, 4, 7]
|
| 180 |
+
[2, 5, 8]
|
| 181 |
+
[3, 6, 9]
|
| 182 |
+
```
|
| 183 |
|
| 184 |
+
```python
|
| 185 |
+
import numpy as np
|
| 186 |
+
|
| 187 |
+
def transpose(matrix):
|
| 188 |
+
try:
|
| 189 |
+
if len(matrix) != 3 or any(len(row) != 3 for row in matrix):
|
| 190 |
+
raise ValueError("Input must be a 3x3 matrix.")
|
| 191 |
+
|
| 192 |
+
# Transpose using numpy's transpose function
|
| 193 |
+
transposed_matrix = np.array(matrix).T.tolist()
|
| 194 |
+
return transposed_matrix
|
| 195 |
+
except Exception as e:
|
| 196 |
+
print(f"An error occurred: {e}")
|
| 197 |
+
return None
|
| 198 |
|
| 199 |
+
if __name__ == "__main__":
|
| 200 |
+
matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
|
| 201 |
+
transposed_matrix = transpose(matrix)
|
| 202 |
+
if transposed_matrix is not None:
|
| 203 |
+
print("Original Matrix:")
|
| 204 |
+
for row in matrix:
|
| 205 |
+
print(row)
|
| 206 |
+
print("
|
| 207 |
+
Transposed Matrix:")
|
| 208 |
+
for row in transposed_matrix:
|
| 209 |
+
print(row)
|
| 210 |
+
```
|
| 211 |
+
<!-- slide -->
|
| 212 |
+
### π¨ Task 4: Run-length Encoding (JavaScript)
|
| 213 |
+
* **Prompt**: *"Write a JavaScript function rle(input) that performs run-length encoding on a string. For example, 'AABBBCCCC' should return 'A2B3C4'. Call it with 'AABBBCCCC' in the main block and print the result using console.log. Do not use interactive prompt() calls."*
|
| 214 |
+
* **GNN Concept Path**: `String Parsing in JavaScript` β `String Execution in JavaScript` β `String Validation in JavaScript`
|
| 215 |
+
* **Generation Time**: 9.93 seconds
|
| 216 |
+
* **Sandbox Output**: `A2B3C4`
|
| 217 |
+
|
| 218 |
+
```javascript
|
| 219 |
+
// Function to perform run-length encoding on a string
|
| 220 |
+
function rle(input) {
|
| 221 |
+
if (typeof input !== 'string') {
|
| 222 |
+
throw new Error('Input must be a string');
|
| 223 |
+
}
|
| 224 |
+
|
| 225 |
+
let encoded = '';
|
| 226 |
+
let count = 1;
|
| 227 |
+
|
| 228 |
+
for (let i = 1; i < input.length; i++) {
|
| 229 |
+
if (input[i] === input[i - 1]) {
|
| 230 |
+
count++;
|
| 231 |
+
} else {
|
| 232 |
+
encoded += input[i - 1] + count;
|
| 233 |
+
count = 1;
|
| 234 |
+
}
|
| 235 |
+
}
|
| 236 |
+
|
| 237 |
+
// Add the last character and its count
|
| 238 |
+
encoded += input[input.length - 1] + count;
|
| 239 |
+
return encoded;
|
| 240 |
+
}
|
| 241 |
+
|
| 242 |
+
// Main block to test the rle function
|
| 243 |
+
try {
|
| 244 |
+
const inputString = 'AABBBCCCC';
|
| 245 |
+
const result = rle(inputString);
|
| 246 |
+
console.log(result); // Output: A2B3C4
|
| 247 |
+
} catch (error) {
|
| 248 |
+
console.error('Error:', error.message);
|
| 249 |
+
}
|
| 250 |
+
```
|
| 251 |
+
<!-- slide -->
|
| 252 |
+
### π Task 5: Bubble Sort (Python)
|
| 253 |
+
* **Prompt**: *"Write a Python function bubble_sort(arr) that sorts an array of integers in ascending order. Test it with inputs arr=[64, 34, 25, 12, 22, 11, 90], print the sorted array, and do not use interactive input() calls."*
|
| 254 |
+
* **GNN Concept Path**: `Array Optimization in Python` β `Array Parsing in Python` β `Array Execution in Python`
|
| 255 |
+
* **Generation Time**: 8.75 seconds
|
| 256 |
+
* **Sandbox Output**:
|
| 257 |
+
```text
|
| 258 |
+
Original array: [64, 34, 25, 12, 22, 11, 90]
|
| 259 |
+
Sorted array: [11, 12, 22, 25, 34, 64, 90]
|
| 260 |
+
```
|
| 261 |
+
|
| 262 |
+
```python
|
| 263 |
+
# Bubble Sort Function in Python
|
| 264 |
+
|
| 265 |
+
def bubble_sort(arr):
|
| 266 |
+
n = len(arr)
|
| 267 |
+
for i in range(n):
|
| 268 |
+
for j in range(0, n-i-1):
|
| 269 |
+
if arr[j] > arr[j+1]:
|
| 270 |
+
arr[j], arr[j+1] = arr[j+1], arr[j]
|
| 271 |
+
|
| 272 |
+
if __name__ == "__main__":
|
| 273 |
+
arr = [64, 34, 25, 12, 22, 11, 90]
|
| 274 |
+
try:
|
| 275 |
+
print("Original array:", arr)
|
| 276 |
+
bubble_sort(arr)
|
| 277 |
+
print("Sorted array:", arr)
|
| 278 |
+
except Exception as e:
|
| 279 |
+
print(f"An error occurred: {e}")
|
| 280 |
+
```
|
| 281 |
+
````
|
| 282 |
|
| 283 |
---
|
| 284 |
|