{"id":878,"date":"2025-07-30T01:23:00","date_gmt":"2025-07-30T01:23:00","guid":{"rendered":"https:\/\/ouyangminwei.com\/?p=878"},"modified":"2025-07-18T09:25:15","modified_gmt":"2025-07-18T09:25:15","slug":"mor-vs-transformer","status":"publish","type":"post","link":"https:\/\/ouyangminwei.com\/index.php\/2025\/07\/30\/mor-vs-transformer\/","title":{"rendered":"mor vs transformer"},"content":{"rendered":"\n<!DOCTYPE html>\n<html lang=\"zh-Hant\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>\u4e92\u52d5\u5206\u6790\uff1aMixture-of-Recursions vs. Transformer<\/title>\n    <script src=\"https:\/\/cdn.tailwindcss.com\"><\/script>\n    <script src=\"https:\/\/cdn.jsdelivr.net\/npm\/chart.js\"><\/script>\n    <link rel=\"preconnect\" href=\"https:\/\/fonts.googleapis.com\">\n    <link rel=\"preconnect\" href=\"https:\/\/fonts.gstatic.com\" crossorigin>\n    <link href=\"https:\/\/fonts.googleapis.com\/css2?family=Noto+Sans+TC:wght@400;500;700&#038;display=swap\" rel=\"stylesheet\">\n    <!-- Chosen Palette: Warm Neutral Slate -->\n    <!-- Application Structure Plan: A thematic, comparative SPA design with 5 sections: Intro, Side-by-Side Model Intro, Interactive Mechanism Deep Dive, Performance Chart, and Summary Table. This structure guides the user from high-level concepts to detailed, interactive comparisons, which is more intuitive for understanding a complex technical topic than a linear document. The core is the interactive mechanism visualization, allowing direct comparison of information flow. -->\n    <!-- Visualization & Content Choices: \n        1. Mechanism Diagram: Goal: Compare information flow. Method: HTML\/CSS buttons + Canvas diagrams. Interaction: User clicks to toggle between Transformer and MoR views, which updates both the canvas drawing and an adjacent text block. Justification: A static diagram can't show the process difference effectively. An interactive canvas diagram makes the abstract concept of 'global attention' vs 'dynamic routing' concrete and easy to grasp. Library\/Method: Vanilla JS Canvas API.\n        2. Complexity Chart: Goal: Compare computational cost. Method: Bar chart. Interaction: Hover for tooltips showing complexity formulas. Justification: A bar chart provides an immediate, powerful visual comparison of the performance difference, which is a key selling point of MoR. Library\/Method: Chart.js.\n        3. Summary Table: Goal: Organize and summarize all key differences. Method: Styled HTML table. Interaction: N\/A (static content). Justification: Provides a final, comprehensive reference for users to consolidate their understanding. Library\/Method: HTML\/Tailwind. -->\n    <!-- CONFIRMATION: NO SVG graphics used. NO Mermaid JS used. -->\n    <style>\n        body {\n            font-family: 'Noto Sans TC', sans-serif;\n            background-color: #f8f7f4;\n            color: #3d3d3d;\n        }\n        .chart-container {\n            position: relative;\n            width: 100%;\n            max-width: 700px;\n            margin-left: auto;\n            margin-right: auto;\n            height: 350px;\n            max-height: 400px;\n        }\n        @media (min-width: 768px) {\n            .chart-container {\n                height: 400px;\n            }\n        }\n        .active-btn {\n            background-color: #1e293b !important;\n            color: #ffffff !important;\n            transform: scale(1.05);\n        }\n        .inactive-btn {\n             background-color: #64748b;\n             color: #e2e8f0;\n        }\n    <\/style>\n<\/head>\n<body class=\"antialiased\">\n    <div class=\"container mx-auto px-4 sm:px-6 lg:px-8 py-12\">\n        <header class=\"text-center mb-16\">\n            <h1 class=\"text-4xl md:text-5xl font-bold text-slate-800 mb-4\">\u6df1\u5165\u63a2\u7d22\uff1aMoR vs. Transformer<\/h1>\n            <p class=\"text-lg text-slate-600 max-w-3xl mx-auto\">\n                \u6b61\u8fce\u4f86\u5230 Mixture-of-Recursions (MoR) \u8207 Transformer \u7684\u4e92\u52d5\u6307\u5357\u3002\u672c\u9801\u9762\u5c07\u900f\u904e\u8996\u89ba\u5316\u5716\u8868\u548c\u4e92\u52d5\u5f0f\u5143\u4ef6\uff0c\u5e6b\u52a9\u60a8\u8f15\u9b06\u7406\u89e3\u9019\u5169\u7a2e\u5f37\u5927 AI \u67b6\u69cb\u7684\u6838\u5fc3\u5dee\u7570\u3001\u904b\u4f5c\u6a5f\u5236\u8207\u6027\u80fd\u8868\u73fe\u3002\n            <\/p>\n        <\/header>\n\n        <main class=\"space-y-20\">\n            <section id=\"introduction\">\n                <h2 class=\"text-3xl font-bold text-slate-700 text-center mb-10\">\u5169\u5927\u4e3b\u89d2\u4ecb\u7d39<\/h2>\n                 <p class=\"text-md text-slate-600 max-w-3xl mx-auto text-center mb-12\">\n                    \u5728\u6211\u5011\u6df1\u5165\u6bd4\u8f03\u4e4b\u524d\uff0c\u8b93\u6211\u5011\u5148\u5206\u5225\u8a8d\u8b58\u4e00\u4e0b\u9019\u5169\u500b\u6a21\u578b\u3002Transformer \u4ee5\u5176\u5f37\u5927\u7684\u300c\u6ce8\u610f\u529b\u6a5f\u5236\u300d\u805e\u540d\uff0c\u800c MoR \u5247\u63d0\u51fa\u4e86\u4e00\u7a2e\u65b0\u7a4e\u7684\u300c\u905e\u8ff4\u6df7\u5408\u300d\u65b9\u6cd5\u3002\u672c\u7bc0\u5c07\u7c21\u8981\u4ecb\u7d39\u5b83\u5011\u5404\u81ea\u7684\u6838\u5fc3\u601d\u60f3\u3002\n                <\/p>\n                <div class=\"grid md:grid-cols-2 gap-8 max-w-5xl mx-auto\">\n                    <div class=\"bg-white rounded-xl shadow-lg p-8 transform hover:scale-105 transition-transform duration-300\">\n                        <div class=\"flex items-center mb-4\">\n                            <div class=\"p-3 bg-amber-100 rounded-full mr-4\">\n                                <span class=\"text-2xl\">\ud83c\udf10<\/span>\n                            <\/div>\n                            <h3 class=\"text-2xl font-bold text-slate-800\">Transformer (\u6ce8\u610f\u529b\u6a21\u578b)<\/h3>\n                        <\/div>\n                        <p class=\"text-slate-600 leading-relaxed\">\n                            Transformer \u7684\u6838\u5fc3\u662f\u300c\u81ea\u6ce8\u610f\u529b\u6a5f\u5236\u300d\uff08Self-Attention\uff09\u3002\u5b83\u5728\u8655\u7406\u5e8f\u5217\u4e2d\u7684\u6bcf\u500b\u5143\u7d20\uff08\u4f8b\u5982\u4e00\u500b\u8a5e\uff09\u6642\uff0c\u6703\u8a08\u7b97\u8a72\u5143\u7d20\u8207\u5e8f\u5217\u4e2d\u6240\u6709\u5176\u4ed6\u5143\u7d20\u7684\u95dc\u806f\u6027\u5206\u6578\u3002\u9019\u4f7f\u5f97\u6a21\u578b\u80fd\u5920\u6355\u6349\u9577\u8ddd\u96e2\u7684\u4f9d\u8cf4\u95dc\u4fc2\uff0c\u5be6\u73fe\u4e86\u9ad8\u5ea6\u7684\u5e73\u884c\u5316\u8a08\u7b97\uff0c\u6210\u70ba\u7576\u4ee3\u5927\u578b\u8a9e\u8a00\u6a21\u578b\u7684\u57fa\u77f3\u3002\n                        <\/p>\n                    <\/div>\n                    <div class=\"bg-white rounded-xl shadow-lg p-8 transform hover:scale-105 transition-transform duration-300\">\n                        <div class=\"flex items-center mb-4\">\n                            <div class=\"p-3 bg-sky-100 rounded-full mr-4\">\n                               <span class=\"text-2xl\">\ud83c\udf3f<\/span>\n                            <\/div>\n                            <h3 class=\"text-2xl font-bold text-slate-800\">Mixture-of-Recursions (MoR)<\/h3>\n                        <\/div>\n                        <p class=\"text-slate-600 leading-relaxed\">\n                            MoR \u63d0\u51fa\u4e86\u4e00\u7a2e\u66ff\u4ee3\u65b9\u6848\u3002\u5b83\u4e0d\u4f7f\u7528\u5168\u5c40\u6ce8\u610f\u529b\uff0c\u800c\u662f\u63a1\u7528\u4e00\u7a2e\u52d5\u614b\u7684\u3001\u4f9d\u8cf4\u65bc\u8f38\u5165\u7684\u905e\u8ff4\u6df7\u5408\u5c08\u5bb6\u6a21\u578b\u3002\u5c0d\u65bc\u5e8f\u5217\u4e2d\u7684\u6bcf\u500b\u4f4d\u7f6e\uff0cMoR \u6703\u900f\u904e\u4e00\u500b\u300c\u8def\u7531\u5668\u300d\u9078\u64c7\u4e00\u500b\u6216\u591a\u500b\u5c08\u9580\u7684\u905e\u8ff4\u300c\u5c08\u5bb6\u300d\u4f86\u9032\u884c\u8655\u7406\u3002\u9019\u7a2e\u65b9\u6cd5\u65e8\u5728\u63d0\u9ad8\u8a08\u7b97\u6548\u7387\uff0c\u4e26\u53ef\u80fd\u5728\u7279\u5b9a\u4efb\u52d9\u4e0a\u5be6\u73fe\u66f4\u597d\u7684\u6027\u80fd\u3002\n                        <\/p>\n                    <\/div>\n                <\/div>\n            <\/section>\n\n            <section id=\"mechanism\">\n                <h2 class=\"text-3xl font-bold text-slate-700 text-center mb-10\">\u6838\u5fc3\u6a5f\u5236\u5c0d\u6bd4<\/h2>\n                <p class=\"text-md text-slate-600 max-w-3xl mx-auto text-center mb-12\">\n                    \u9019\u662f\u5169\u8005\u6700\u6839\u672c\u7684\u5340\u5225\u6240\u5728\u3002Transformer \u5c0d\u5e8f\u5217\u4e2d\u7684\u6240\u6709\u5143\u7d20\u9032\u884c\u5168\u5c40\u6027\u7684\u3001\u5bc6\u96c6\u7684\u8a08\u7b97\uff0c\u800c MoR \u5247\u9032\u884c\u9078\u64c7\u6027\u7684\u3001\u7a00\u758f\u7684\u8a08\u7b97\u3002\u9ede\u64ca\u4e0b\u65b9\u6309\u9215\uff0c\u5207\u63db\u89c0\u770b\u5169\u7a2e\u6a5f\u5236\u7684\u52d5\u614b\u8cc7\u8a0a\u6d41\u793a\u610f\u5716\uff0c\u89aa\u8eab\u9ad4\u9a57\u5b83\u5011\u7684\u904b\u4f5c\u65b9\u5f0f\u3002\n                <\/p>\n                <div class=\"text-center mb-8\">\n                    <button id=\"show-transformer\" class=\"text-lg font-semibold py-3 px-6 rounded-lg transition-all duration-300 mx-2 active-btn\">Transformer \u6ce8\u610f\u529b\u6a5f\u5236<\/button>\n                    <button id=\"show-mor\" class=\"text-lg font-semibold py-3 px-6 rounded-lg transition-all duration-300 mx-2 inactive-btn\">MoR \u905e\u8ff4\u6df7\u5408<\/button>\n                <\/div>\n                <div class=\"bg-white rounded-xl shadow-lg p-8 max-w-5xl mx-auto grid md:grid-cols-2 gap-8 items-center\">\n                    <div class=\"w-full h-80 bg-slate-50 rounded-lg\">\n                        <canvas id=\"mechanismCanvas\"><\/canvas>\n                    <\/div>\n                    <div>\n                        <h3 id=\"mechanism-title\" class=\"text-2xl font-bold text-slate-800 mb-4\"><\/h3>\n                        <p id=\"mechanism-text\" class=\"text-slate-600 leading-relaxed\"><\/p>\n                    <\/div>\n                <\/div>\n            <\/section>\n            \n            <section id=\"performance\">\n                <h2 class=\"text-3xl font-bold text-slate-700 text-center mb-10\">\u6027\u80fd\u8207\u8a08\u7b97\u8907\u96dc\u5ea6<\/h2>\n                 <p class=\"text-md text-slate-600 max-w-3xl mx-auto text-center mb-12\">\n                    \u8a08\u7b97\u6548\u7387\u662f MoR \u67b6\u69cb\u63d0\u51fa\u7684\u4e00\u500b\u95dc\u9375\u512a\u52e2\u3002\u5c0d\u65bc\u9577\u5e8f\u5217\u7684\u8655\u7406\uff0cTransformer \u7684\u4e8c\u6b21\u65b9\u8907\u96dc\u5ea6\u6703\u6210\u70ba\u74f6\u9838\uff0c\u800c MoR \u5247\u6709\u671b\u5c07\u5176\u964d\u4f4e\u3002\u4e0b\u65b9\u7684\u5716\u8868\u76f4\u89c0\u5730\u5c55\u793a\u4e86\u9019\u4e00\u5dee\u7570\u3002\u5c07\u6ed1\u9f20\u61f8\u505c\u5728\u9577\u689d\u4e0a\u53ef\u4ee5\u67e5\u770b\u5177\u9ad4\u7684\u8907\u96dc\u5ea6\u516c\u5f0f\u3002\n                <\/p>\n                <div class=\"bg-white rounded-xl shadow-lg p-8 max-w-5xl mx-auto\">\n                    <h3 class=\"text-xl font-bold text-center text-slate-800 mb-6\">\u8a08\u7b97\u6210\u672c\u6bd4\u8f03<\/h3>\n                    <div class=\"chart-container\">\n                        <canvas id=\"complexityChart\"><\/canvas>\n                    <\/div>\n                <\/div>\n            <\/section>\n            \n            <section id=\"summary\">\n                <h2 class=\"text-3xl font-bold text-slate-700 text-center mb-10\">\u7e3d\u7d50\u6bd4\u8f03<\/h2>\n                 <p class=\"text-md text-slate-600 max-w-3xl mx-auto text-center mb-12\">\n                    \u7d93\u904e\u524d\u9762\u7684\u4ecb\u7d39\u548c\u4e92\u52d5\u63a2\u7d22\uff0c\u73fe\u5728\u8b93\u6211\u5011\u7528\u4e00\u500b\u6e05\u6670\u7684\u8868\u683c\u4f86\u7e3d\u7d50 Transformer \u548c MoR \u5728\u5404\u500b\u7dad\u5ea6\u4e0a\u7684\u6838\u5fc3\u5dee\u7570\u3002\u9019\u5c07\u5e6b\u52a9\u60a8\u5feb\u901f\u56de\u9867\u548c\u978f\u56fa\u5c0d\u9019\u5169\u7a2e\u67b6\u69cb\u7684\u7406\u89e3\u3002\n                <\/p>\n                <div class=\"max-w-5xl mx-auto bg-white rounded-xl shadow-lg overflow-x-auto\">\n                    <table class=\"w-full text-left\">\n                        <thead class=\"bg-slate-100\">\n                            <tr>\n                                <th class=\"p-4 text-lg font-bold text-slate-700\">\u6bd4\u8f03\u7dad\u5ea6<\/th>\n                                <th class=\"p-4 text-lg font-bold text-slate-700\">Transformer (\u6ce8\u610f\u529b)<\/th>\n                                <th class=\"p-4 text-lg font-bold text-slate-700\">Mixture-of-Recursions (MoR)<\/th>\n                            <\/tr>\n                        <\/thead>\n                        <tbody>\n                            <tr class=\"border-b border-slate-200\">\n                                <td class=\"p-4 font-semibold\">\u6838\u5fc3\u6a5f\u5236<\/td>\n                                <td class=\"p-4\">\u5168\u5c40\u81ea\u6ce8\u610f\u529b\uff0c\u6240\u6709 token \u5c0d\u4e4b\u9593\u9032\u884c\u8a08\u7b97<\/td>\n                                <td class=\"p-4\">\u52d5\u614b\u8def\u7531 + \u905e\u8ff4\u5c08\u5bb6\u6a21\u578b<\/td>\n                            <\/tr>\n                            <tr class=\"border-b border-slate-200\">\n                                <td class=\"p-4 font-semibold\">\u8a08\u7b97\u8907\u96dc\u5ea6<\/td>\n                                <td class=\"p-4\">\u4e8c\u6b21\u65b9 &#8211; $O(n^2)$ (n\u70ba\u5e8f\u5217\u9577\u5ea6)<\/td>\n                                <td class=\"p-4\">\u8fd1\u7dda\u6027\u6216\u6b21\u4e8c\u6b21\u65b9 &#8211; $O(n \\cdot \\log n)$ \u6216\u985e\u4f3c<\/td>\n                            <\/tr>\n                            <tr class=\"border-b border-slate-200\">\n                                <td class=\"p-4 font-semibold\">\u512a\u9ede<\/td>\n                                <td class=\"p-4\">\u64c5\u9577\u6355\u6349\u9577\u8ddd\u96e2\u4f9d\u8cf4\uff0c\u9ad8\u5ea6\u5e73\u884c\u5316<\/td>\n                                <td class=\"p-4\">\u8a08\u7b97\u6548\u7387\u9ad8\uff0c\u5c0d\u9577\u5e8f\u5217\u53cb\u597d\uff0c\u6f5b\u5728\u7684\u66f4\u5f37\u6cdb\u5316\u80fd\u529b<\/td>\n                            <\/tr>\n                            <tr class=\"border-b border-slate-200\">\n                                <td class=\"p-4 font-semibold\">\u7f3a\u9ede<\/td>\n                                <td class=\"p-4\">\u8a08\u7b97\u6210\u672c\u9ad8\uff0c\u8a18\u61b6\u9ad4\u6d88\u8017\u5927<\/td>\n                                <td class=\"p-4\">\u905e\u8ff4\u7d50\u69cb\u53ef\u80fd\u964d\u4f4e\u5e73\u884c\u6027\uff0c\u6a21\u578b\u8a2d\u8a08\u66f4\u8907\u96dc<\/td>\n                            <\/tr>\n                            <tr>\n                                <td class=\"p-4 font-semibold\">\u9069\u7528\u5834\u666f<\/td>\n                                <td class=\"p-4\">\u901a\u7528\u81ea\u7136\u8a9e\u8a00\u8655\u7406\u3001\u5716\u50cf\u8fa8\u8b58\u7b49<\/td>\n                                <td class=\"p-4\">\u8d85\u9577\u5e8f\u5217\u8655\u7406\u3001\u9ad8\u6548\u80fd\u63a8\u8ad6\u5834\u666f<\/td>\n                            <\/tr>\n                        <\/tbody>\n                    <\/table>\n                <\/div>\n            <\/section>\n        <\/main>\n        \n        <footer class=\"text-center mt-20 pt-8 border-t border-slate-200\">\n            <p class=\"text-slate-500\">\u4e92\u52d5\u5f0f\u5206\u6790\u61c9\u7528\u7a0b\u5f0f &copy; 2025<\/p>\n        <\/footer>\n    <\/div>\n\n    <script>\n        document.addEventListener('DOMContentLoaded', () => {\n            const mechanismCanvas = document.getElementById('mechanismCanvas');\n            const ctx = mechanismCanvas.getContext('2d');\n            const showTransformerBtn = document.getElementById('show-transformer');\n            const showMorBtn = document.getElementById('show-mor');\n            const mechanismTitle = document.getElementById('mechanism-title');\n            const mechanismText = document.getElementById('mechanism-text');\n\n            let canvasWidth, canvasHeight;\n\n            function resizeCanvas() {\n                const container = mechanismCanvas.parentElement;\n                mechanismCanvas.width = container.clientWidth;\n                mechanismCanvas.height = container.clientHeight;\n                canvasWidth = mechanismCanvas.width;\n                canvasHeight = mechanismCanvas.height;\n            }\n\n            function drawNode(x, y, label, color) {\n                ctx.beginPath();\n                ctx.arc(x, y, 20, 0, 2 * Math.PI);\n                ctx.fillStyle = color;\n                ctx.fill();\n                ctx.fillStyle = '#1e293b';\n                ctx.font = 'bold 16px Noto Sans TC';\n                ctx.textAlign = 'center';\n                ctx.textBaseline = 'middle';\n                ctx.fillText(label, x, y);\n            }\n\n            function drawLine(x1, y1, x2, y2, color, dashed = false) {\n                ctx.beginPath();\n                ctx.moveTo(x1, y1);\n                ctx.lineTo(x2, y2);\n                ctx.strokeStyle = color;\n                ctx.lineWidth = 1.5;\n                if (dashed) {\n                    ctx.setLineDash([5, 5]);\n                } else {\n                    ctx.setLineDash([]);\n                }\n                ctx.stroke();\n            }\n\n            function drawTransformerMechanism() {\n                ctx.clearRect(0, 0, canvasWidth, canvasHeight);\n                const nodes = [\n                    { label: 'T1', x: canvasWidth * 0.15, y: canvasHeight \/ 2 },\n                    { label: 'T2', x: canvasWidth * 0.35, y: canvasHeight \/ 2 },\n                    { label: 'T3', x: canvasWidth * 0.55, y: canvasHeight \/ 2 },\n                    { label: 'T4', x: canvasWidth * 0.75, y: canvasHeight \/ 2 },\n                ];\n\n                const focusNode = nodes[1];\n\n                nodes.forEach((node, i) => {\n                    const color = i === 1 ? '#fcd34d' : '#e2e8f0';\n                    drawNode(node.x, node.y, node.label, color);\n                });\n\n                nodes.forEach(node => {\n                    if (node !== focusNode) {\n                        drawLine(focusNode.x, focusNode.y, node.x, node.y, 'rgba(245, 158, 11, 0.6)');\n                    }\n                });\n                \n                ctx.fillStyle = '#475569';\n                ctx.font = '14px Noto Sans TC';\n                ctx.textAlign = 'center';\n                ctx.fillText('\u4e00\u500bToken (T2) \u6703\u95dc\u6ce8\u5e8f\u5217\u4e2d\u6240\u6709\u7684Token', canvasWidth \/ 2, canvasHeight * 0.85);\n\n            }\n            \n            function drawMoRMechanism() {\n                ctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\n                const startNode = { label: 'T2', x: canvasWidth * 0.15, y: canvasHeight \/ 2 };\n                const routerNode = { label: 'Router', x: canvasWidth * 0.4, y: canvasHeight \/ 2 };\n                const experts = [\n                    { label: 'E1', x: canvasWidth * 0.75, y: canvasHeight * 0.2 },\n                    { label: 'E2', x: canvasWidth * 0.75, y: canvasHeight * 0.5 },\n                    { label: 'E3', x: canvasWidth * 0.75, y: canvasHeight * 0.8 },\n                ];\n\n                drawNode(startNode.x, startNode.y, startNode.label, '#fcd34d');\n                drawNode(routerNode.x, routerNode.y, routerNode.label, '#bae6fd');\n                \n                drawLine(startNode.x, startNode.y, routerNode.x, routerNode.y, '#38bdf8');\n\n                experts.forEach((expert, i) => {\n                    const isSelected = i === 1; \n                    drawNode(expert.x, expert.y, expert.label, isSelected ? '#67e8f9' : '#e2e8f0');\n                    drawLine(routerNode.x, routerNode.y, expert.x, expert.y, isSelected ? '#0ea5e9' : '#cbd5e1', !isSelected);\n                });\n                \n                ctx.fillStyle = '#475569';\n                ctx.font = '14px Noto Sans TC';\n                ctx.textAlign = 'center';\n                ctx.fillText('Router\u70baToken (T2) \u9078\u64c7\u4e86\u5c08\u5bb6 (E2) \u9032\u884c\u8655\u7406', canvasWidth \/ 2, canvasHeight * 0.95);\n            }\n            \n            function updateMechanismView(type) {\n                resizeCanvas();\n                if (type === 'transformer') {\n                    mechanismTitle.textContent = '\u5168\u5c40\u6ce8\u610f\u529b\u6a5f\u5236';\n                    mechanismText.innerHTML = '\u5728 Transformer \u4e2d\uff0c\u7576\u6a21\u578b\u8655\u7406\u4e00\u500b token (\u5982 <strong>T2<\/strong>) \u6642\uff0c\u5b83\u6703\u8a08\u7b97\u9019\u500b token \u8207\u5e8f\u5217\u4e2d<strong>\u6240\u6709\u5176\u4ed6 token<\/strong> \u7684\u6ce8\u610f\u529b\u5206\u6578\u3002\u9019\u5c31\u50cf\u4e00\u500b\u5168\u5c40\u6703\u8b70\uff0c\u6bcf\u500b\u6210\u54e1\u90fd\u6703\u548c\u5176\u4ed6\u6240\u6709\u6210\u54e1\u4ea4\u6d41\uff0c\u78ba\u4fdd\u8cc7\u8a0a\u5728\u6574\u500b\u5e8f\u5217\u4e2d\u5145\u5206\u6d41\u52d5\u3002\u9019\u7a2e\u65b9\u5f0f\u96d6\u7136\u5f37\u5927\uff0c\u4f46\u8a08\u7b97\u6210\u672c\u975e\u5e38\u9ad8\u3002';\n                    drawTransformerMechanism();\n                    showTransformerBtn.classList.add('active-btn');\n                    showTransformerBtn.classList.remove('inactive-btn');\n                    showMorBtn.classList.remove('active-btn');\n                    showMorBtn.classList.add('inactive-btn');\n\n                } else if (type === 'mor') {\n                    mechanismTitle.textContent = '\u52d5\u614b\u905e\u8ff4\u6df7\u5408';\n                    mechanismText.innerHTML = '\u5728 MoR \u4e2d\uff0c\u7576\u4e00\u500b token (\u5982 <strong>T2<\/strong>) \u9032\u5165\u6642\uff0c\u4e00\u500b\u300c\u8def\u7531\u5668\u300d(Router) \u6703\u6839\u64da token \u7684\u7279\u6027\uff0c\u70ba\u5b83<strong>\u9078\u64c7\u4e00\u500b\u6216\u5e7e\u500b\u6700\u5408\u9069\u7684\u300c\u5c08\u5bb6\u300d<\/strong>(\u5982 <strong>E2<\/strong>) \u9032\u884c\u8655\u7406\u3002\u9019\u5c31\u50cf\u4e00\u500b\u5c08\u6848\u7d93\u7406\uff0c\u6703\u628a\u4efb\u52d9\u5206\u914d\u7d66\u6700\u64c5\u9577\u7684\u5718\u968a\u6210\u54e1\uff0c\u800c\u4e0d\u662f\u8b93\u6240\u6709\u4eba\u4e00\u8d77\u958b\u6703\u3002\u9019\u7a2e\u65b9\u5f0f\u66f4\u5177\u9078\u64c7\u6027\uff0c\u8a08\u7b97\u6548\u7387\u4e5f\u66f4\u9ad8\u3002';\n                    drawMoRMechanism();\n                    showMorBtn.classList.add('active-btn');\n                    showMorBtn.classList.remove('inactive-btn');\n                    showTransformerBtn.classList.remove('active-btn');\n                    showTransformerBtn.classList.add('inactive-btn');\n                }\n            }\n\n            showTransformerBtn.addEventListener('click', () => updateMechanismView('transformer'));\n            showMorBtn.addEventListener('click', () => updateMechanismView('mor'));\n            \n            window.addEventListener('resize', () => {\n                const currentActive = document.querySelector('.active-btn');\n                if (currentActive.id === 'show-transformer') {\n                    updateMechanismView('transformer');\n                } else {\n                    updateMechanismView('mor');\n                }\n                complexityChart.resize();\n            });\n\n            const complexityCtx = document.getElementById('complexityChart').getContext('2d');\n            const complexityChart = new Chart(complexityCtx, {\n                type: 'bar',\n                data: {\n                    labels: ['Transformer (Attention)', 'Mixture-of-Recursions (MoR)'],\n                    datasets: [{\n                        label: '\u76f8\u5c0d\u8a08\u7b97\u6210\u672c (\u5e8f\u5217\u9577\u5ea6=n)',\n                        data: [100, 25], \n                        backgroundColor: [\n                            'rgba(245, 158, 11, 0.6)',\n                            'rgba(14, 165, 233, 0.6)'\n                        ],\n                        borderColor: [\n                            'rgba(245, 158, 11, 1)',\n                            'rgba(14, 165, 233, 1)'\n                        ],\n                        borderWidth: 1\n                    }]\n                },\n                options: {\n                    responsive: true,\n                    maintainAspectRatio: false,\n                    indexAxis: 'y',\n                    scales: {\n                        x: {\n                            beginAtZero: true,\n                            title: {\n                                display: true,\n                                text: '\u76f8\u5c0d\u8a08\u7b97\u6210\u672c'\n                            }\n                        }\n                    },\n                    plugins: {\n                        legend: {\n                            display: false\n                        },\n                        tooltip: {\n                            callbacks: {\n                                label: function(context) {\n                                    let label = context.dataset.label || '';\n                                    const model = context.label;\n                                    let complexity = '';\n                                    if (model.includes('Transformer')) {\n                                        complexity = 'O(n\u00b2)';\n                                    } else if (model.includes('MoR')) {\n                                        complexity = '\u7d04 O(n log n)';\n                                    }\n                                    return `\u8907\u96dc\u5ea6: ${complexity}`;\n                                }\n                            }\n                        }\n                    }\n                }\n            });\n\n            updateMechanismView('transformer');\n        });\n    <\/script>\n<\/body>\n<\/html>\n\n","protected":false},"excerpt":{"rendered":"<p>\u4e92\u52d5\u5206\u6790\uff1aMixture-of-Recursions vs. Transform &hellip; <a href=\"https:\/\/ouyangminwei.com\/index.php\/2025\/07\/30\/mor-vs-transformer\/\">\u95b1\u8b80\u5168\u6587 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[23],"tags":[],"post_format":[],"class_list":["post-878","post","type-post","status-publish","format-standard","hentry","category-llm"],"_edit_lock":"1774248802:1","_edit_last":"1","_aioseo_title":"#post_title #separator_sa #site_title","_aioseo_description":"#post_excerpt","_aioseo_keywords":"","_aioseo_og_title":"","_aioseo_og_description":"","_aioseo_og_article_section":"","_aioseo_og_article_tags":"","_aioseo_twitter_title":"","_aioseo_twitter_description":"","_oembed_2544c1d0cb3503ab4c4d558c3b3c8873":"","_oembed_time_2544c1d0cb3503ab4c4d558c3b3c8873":"","_oembed_99481806ecbe6ce4ee46f8588d320993":"","_oembed_db663acf973e82e6d9d80df71945dfb8":"","_oembed_16cdfab488f57db73586f4286af2704f":"","_wp_old_slug":"","_links":{"self":[{"href":"https:\/\/ouyangminwei.com\/index.php\/wp-json\/wp\/v2\/posts\/878","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ouyangminwei.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ouyangminwei.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ouyangminwei.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ouyangminwei.com\/index.php\/wp-json\/wp\/v2\/comments?post=878"}],"version-history":[{"count":1,"href":"https:\/\/ouyangminwei.com\/index.php\/wp-json\/wp\/v2\/posts\/878\/revisions"}],"predecessor-version":[{"id":879,"href":"https:\/\/ouyangminwei.com\/index.php\/wp-json\/wp\/v2\/posts\/878\/revisions\/879"}],"wp:attachment":[{"href":"https:\/\/ouyangminwei.com\/index.php\/wp-json\/wp\/v2\/media?parent=878"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ouyangminwei.com\/index.php\/wp-json\/wp\/v2\/categories?post=878"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ouyangminwei.com\/index.php\/wp-json\/wp\/v2\/tags?post=878"},{"taxonomy":"post_format","embeddable":true,"href":"https:\/\/ouyangminwei.com\/index.php\/wp-json\/wp\/v2\/post_format?post=878"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}