[{"data":1,"prerenderedAt":1968},["ShallowReactive",2],{"content-/ai/training-optimization":3,"related-ai":1938},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"keywords":10,"author":11,"date":12,"category":13,"image":14,"body":15,"_type":1932,"_id":1933,"_source":1934,"_file":1935,"_stem":1936,"_extension":1937},"/ai/training-optimization","ai",false,"","模型训练与优化架构","构建高性能、自适应的 AI 模型训练与持续优化体系","模型训练, 微调, LoRA, 持续学习, 性能优化, HTMLPAGE","HTMLPAGE","2025-11-27","AI 技术","/content-images/ai/ai.jpg",{"type":16,"children":17,"toc":1912},"root",[18,26,33,39,44,148,153,162,554,560,566,571,579,879,884,889,922,928,933,938,961,969,1434,1439,1444,1467,1473,1478,1483,1507,1515,1718,1723,1728,1734,1739,1856,1862,1893,1897,1906],{"type":19,"tag":20,"props":21,"children":22},"element","p",{},[23],{"type":24,"value":25},"text","HTMLPAGE 的核心竞争力在于其不断进化的 AI 模型。我们构建了一套工业级的模型训练与优化架构，涵盖了从数据工程、预训练、指令微调（Instruction Tuning）到强化学习（RLHF）的全生命周期管理，确保模型在网页生成领域的专业性和准确性。",{"type":19,"tag":27,"props":28,"children":30},"h2",{"id":29},"️-训练流水线架构",[31],{"type":24,"value":32},"🏗️ 训练流水线架构",{"type":19,"tag":34,"props":35,"children":37},"h3",{"id":36},"全链路数据处理管道",[38],{"type":24,"value":36},{"type":19,"tag":20,"props":40,"children":41},{},[42],{"type":24,"value":43},"高质量的数据是模型效果的基石。我们建立了一个自动化的数据处理流水线，处理来自公开数据集、用户反馈和合成数据的海量信息。",{"type":19,"tag":45,"props":46,"children":50},"pre",{"className":47,"code":48,"language":49,"meta":7,"style":7},"language-mermaid shiki shiki-themes github-dark github-dark","graph LR\n    A[原始数据源] --> B(数据清洗与去重)\n    B --> C(隐私脱敏)\n    C --> D(质量评分与过滤)\n    D --> E(格式标准化)\n    E --> F[训练数据集]\n    F --> G{模型训练}\n    G --> H[模型评估]\n    H -->|不合格| F\n    H -->|合格| I[模型部署]\n","mermaid",[51],{"type":19,"tag":52,"props":53,"children":54},"code",{"__ignoreMap":7},[55,67,76,85,94,103,112,121,130,139],{"type":19,"tag":56,"props":57,"children":60},"span",{"class":58,"line":59},"line",1,[61],{"type":19,"tag":56,"props":62,"children":64},{"style":63},"--shiki-default:#E1E4E8;--shiki-dark:#E1E4E8",[65],{"type":24,"value":66},"graph LR\n",{"type":19,"tag":56,"props":68,"children":70},{"class":58,"line":69},2,[71],{"type":19,"tag":56,"props":72,"children":73},{"style":63},[74],{"type":24,"value":75},"    A[原始数据源] --> B(数据清洗与去重)\n",{"type":19,"tag":56,"props":77,"children":79},{"class":58,"line":78},3,[80],{"type":19,"tag":56,"props":81,"children":82},{"style":63},[83],{"type":24,"value":84},"    B --> C(隐私脱敏)\n",{"type":19,"tag":56,"props":86,"children":88},{"class":58,"line":87},4,[89],{"type":19,"tag":56,"props":90,"children":91},{"style":63},[92],{"type":24,"value":93},"    C --> D(质量评分与过滤)\n",{"type":19,"tag":56,"props":95,"children":97},{"class":58,"line":96},5,[98],{"type":19,"tag":56,"props":99,"children":100},{"style":63},[101],{"type":24,"value":102},"    D --> E(格式标准化)\n",{"type":19,"tag":56,"props":104,"children":106},{"class":58,"line":105},6,[107],{"type":19,"tag":56,"props":108,"children":109},{"style":63},[110],{"type":24,"value":111},"    E --> F[训练数据集]\n",{"type":19,"tag":56,"props":113,"children":115},{"class":58,"line":114},7,[116],{"type":19,"tag":56,"props":117,"children":118},{"style":63},[119],{"type":24,"value":120},"    F --> G{模型训练}\n",{"type":19,"tag":56,"props":122,"children":124},{"class":58,"line":123},8,[125],{"type":19,"tag":56,"props":126,"children":127},{"style":63},[128],{"type":24,"value":129},"    G --> H[模型评估]\n",{"type":19,"tag":56,"props":131,"children":133},{"class":58,"line":132},9,[134],{"type":19,"tag":56,"props":135,"children":136},{"style":63},[137],{"type":24,"value":138},"    H -->|不合格| F\n",{"type":19,"tag":56,"props":140,"children":142},{"class":58,"line":141},10,[143],{"type":19,"tag":56,"props":144,"children":145},{"style":63},[146],{"type":24,"value":147},"    H -->|合格| I[模型部署]\n",{"type":19,"tag":34,"props":149,"children":151},{"id":150},"数据工程实现",[152],{"type":24,"value":150},{"type":19,"tag":20,"props":154,"children":155},{},[156],{"type":19,"tag":157,"props":158,"children":159},"strong",{},[160],{"type":24,"value":161},"自动化数据增强脚本示例",{"type":19,"tag":45,"props":163,"children":167},{"className":164,"code":165,"language":166,"meta":7,"style":7},"language-python shiki shiki-themes github-dark github-dark","class DataAugmentationPipeline:\n    def __init__(self):\n        self.back_translator = BackTranslationAugmenter()\n        self.synonym_replacer = SynonymReplacer()\n        self.code_mutator = CodeStructureMutator()\n    \n    def augment_dataset(self, dataset):\n        augmented_data = []\n        \n        for sample in dataset:\n            # 1. 文本回译增强 (中文 -> 英文 -> 中文)\n            if sample.type == 'text':\n                aug_sample = self.back_translator.augment(sample.content)\n                augmented_data.append(aug_sample)\n            \n            # 2. 代码结构变异 (保持逻辑不变，改变语法结构)\n            elif sample.type == 'code':\n                mutated_code = self.code_mutator.mutate(\n                    sample.content, \n                    strategy='variable_renaming'\n                )\n                augmented_data.append(mutated_code)\n                \n        return augmented_data\n","python",[168],{"type":19,"tag":52,"props":169,"children":170},{"__ignoreMap":7},[171,191,210,233,254,275,283,300,317,325,348,358,387,410,419,428,437,463,485,494,513,522,531,540],{"type":19,"tag":56,"props":172,"children":173},{"class":58,"line":59},[174,180,186],{"type":19,"tag":56,"props":175,"children":177},{"style":176},"--shiki-default:#F97583;--shiki-dark:#F97583",[178],{"type":24,"value":179},"class",{"type":19,"tag":56,"props":181,"children":183},{"style":182},"--shiki-default:#B392F0;--shiki-dark:#B392F0",[184],{"type":24,"value":185}," DataAugmentationPipeline",{"type":19,"tag":56,"props":187,"children":188},{"style":63},[189],{"type":24,"value":190},":\n",{"type":19,"tag":56,"props":192,"children":193},{"class":58,"line":69},[194,199,205],{"type":19,"tag":56,"props":195,"children":196},{"style":176},[197],{"type":24,"value":198},"    def",{"type":19,"tag":56,"props":200,"children":202},{"style":201},"--shiki-default:#79B8FF;--shiki-dark:#79B8FF",[203],{"type":24,"value":204}," __init__",{"type":19,"tag":56,"props":206,"children":207},{"style":63},[208],{"type":24,"value":209},"(self):\n",{"type":19,"tag":56,"props":211,"children":212},{"class":58,"line":78},[213,218,223,228],{"type":19,"tag":56,"props":214,"children":215},{"style":201},[216],{"type":24,"value":217},"        self",{"type":19,"tag":56,"props":219,"children":220},{"style":63},[221],{"type":24,"value":222},".back_translator ",{"type":19,"tag":56,"props":224,"children":225},{"style":176},[226],{"type":24,"value":227},"=",{"type":19,"tag":56,"props":229,"children":230},{"style":63},[231],{"type":24,"value":232}," BackTranslationAugmenter()\n",{"type":19,"tag":56,"props":234,"children":235},{"class":58,"line":87},[236,240,245,249],{"type":19,"tag":56,"props":237,"children":238},{"style":201},[239],{"type":24,"value":217},{"type":19,"tag":56,"props":241,"children":242},{"style":63},[243],{"type":24,"value":244},".synonym_replacer ",{"type":19,"tag":56,"props":246,"children":247},{"style":176},[248],{"type":24,"value":227},{"type":19,"tag":56,"props":250,"children":251},{"style":63},[252],{"type":24,"value":253}," SynonymReplacer()\n",{"type":19,"tag":56,"props":255,"children":256},{"class":58,"line":96},[257,261,266,270],{"type":19,"tag":56,"props":258,"children":259},{"style":201},[260],{"type":24,"value":217},{"type":19,"tag":56,"props":262,"children":263},{"style":63},[264],{"type":24,"value":265},".code_mutator ",{"type":19,"tag":56,"props":267,"children":268},{"style":176},[269],{"type":24,"value":227},{"type":19,"tag":56,"props":271,"children":272},{"style":63},[273],{"type":24,"value":274}," CodeStructureMutator()\n",{"type":19,"tag":56,"props":276,"children":277},{"class":58,"line":105},[278],{"type":19,"tag":56,"props":279,"children":280},{"style":63},[281],{"type":24,"value":282},"    \n",{"type":19,"tag":56,"props":284,"children":285},{"class":58,"line":114},[286,290,295],{"type":19,"tag":56,"props":287,"children":288},{"style":176},[289],{"type":24,"value":198},{"type":19,"tag":56,"props":291,"children":292},{"style":182},[293],{"type":24,"value":294}," augment_dataset",{"type":19,"tag":56,"props":296,"children":297},{"style":63},[298],{"type":24,"value":299},"(self, dataset):\n",{"type":19,"tag":56,"props":301,"children":302},{"class":58,"line":123},[303,308,312],{"type":19,"tag":56,"props":304,"children":305},{"style":63},[306],{"type":24,"value":307},"        augmented_data ",{"type":19,"tag":56,"props":309,"children":310},{"style":176},[311],{"type":24,"value":227},{"type":19,"tag":56,"props":313,"children":314},{"style":63},[315],{"type":24,"value":316}," []\n",{"type":19,"tag":56,"props":318,"children":319},{"class":58,"line":132},[320],{"type":19,"tag":56,"props":321,"children":322},{"style":63},[323],{"type":24,"value":324},"        \n",{"type":19,"tag":56,"props":326,"children":327},{"class":58,"line":141},[328,333,338,343],{"type":19,"tag":56,"props":329,"children":330},{"style":176},[331],{"type":24,"value":332},"        for",{"type":19,"tag":56,"props":334,"children":335},{"style":63},[336],{"type":24,"value":337}," sample ",{"type":19,"tag":56,"props":339,"children":340},{"style":176},[341],{"type":24,"value":342},"in",{"type":19,"tag":56,"props":344,"children":345},{"style":63},[346],{"type":24,"value":347}," dataset:\n",{"type":19,"tag":56,"props":349,"children":351},{"class":58,"line":350},11,[352],{"type":19,"tag":56,"props":353,"children":355},{"style":354},"--shiki-default:#6A737D;--shiki-dark:#6A737D",[356],{"type":24,"value":357},"            # 1. 文本回译增强 (中文 -> 英文 -> 中文)\n",{"type":19,"tag":56,"props":359,"children":361},{"class":58,"line":360},12,[362,367,372,377,383],{"type":19,"tag":56,"props":363,"children":364},{"style":176},[365],{"type":24,"value":366},"            if",{"type":19,"tag":56,"props":368,"children":369},{"style":63},[370],{"type":24,"value":371}," sample.type ",{"type":19,"tag":56,"props":373,"children":374},{"style":176},[375],{"type":24,"value":376},"==",{"type":19,"tag":56,"props":378,"children":380},{"style":379},"--shiki-default:#9ECBFF;--shiki-dark:#9ECBFF",[381],{"type":24,"value":382}," 'text'",{"type":19,"tag":56,"props":384,"children":385},{"style":63},[386],{"type":24,"value":190},{"type":19,"tag":56,"props":388,"children":390},{"class":58,"line":389},13,[391,396,400,405],{"type":19,"tag":56,"props":392,"children":393},{"style":63},[394],{"type":24,"value":395},"                aug_sample ",{"type":19,"tag":56,"props":397,"children":398},{"style":176},[399],{"type":24,"value":227},{"type":19,"tag":56,"props":401,"children":402},{"style":201},[403],{"type":24,"value":404}," self",{"type":19,"tag":56,"props":406,"children":407},{"style":63},[408],{"type":24,"value":409},".back_translator.augment(sample.content)\n",{"type":19,"tag":56,"props":411,"children":413},{"class":58,"line":412},14,[414],{"type":19,"tag":56,"props":415,"children":416},{"style":63},[417],{"type":24,"value":418},"                augmented_data.append(aug_sample)\n",{"type":19,"tag":56,"props":420,"children":422},{"class":58,"line":421},15,[423],{"type":19,"tag":56,"props":424,"children":425},{"style":63},[426],{"type":24,"value":427},"            \n",{"type":19,"tag":56,"props":429,"children":431},{"class":58,"line":430},16,[432],{"type":19,"tag":56,"props":433,"children":434},{"style":354},[435],{"type":24,"value":436},"            # 2. 代码结构变异 (保持逻辑不变，改变语法结构)\n",{"type":19,"tag":56,"props":438,"children":440},{"class":58,"line":439},17,[441,446,450,454,459],{"type":19,"tag":56,"props":442,"children":443},{"style":176},[444],{"type":24,"value":445},"            elif",{"type":19,"tag":56,"props":447,"children":448},{"style":63},[449],{"type":24,"value":371},{"type":19,"tag":56,"props":451,"children":452},{"style":176},[453],{"type":24,"value":376},{"type":19,"tag":56,"props":455,"children":456},{"style":379},[457],{"type":24,"value":458}," 'code'",{"type":19,"tag":56,"props":460,"children":461},{"style":63},[462],{"type":24,"value":190},{"type":19,"tag":56,"props":464,"children":466},{"class":58,"line":465},18,[467,472,476,480],{"type":19,"tag":56,"props":468,"children":469},{"style":63},[470],{"type":24,"value":471},"                mutated_code ",{"type":19,"tag":56,"props":473,"children":474},{"style":176},[475],{"type":24,"value":227},{"type":19,"tag":56,"props":477,"children":478},{"style":201},[479],{"type":24,"value":404},{"type":19,"tag":56,"props":481,"children":482},{"style":63},[483],{"type":24,"value":484},".code_mutator.mutate(\n",{"type":19,"tag":56,"props":486,"children":488},{"class":58,"line":487},19,[489],{"type":19,"tag":56,"props":490,"children":491},{"style":63},[492],{"type":24,"value":493},"                    sample.content, \n",{"type":19,"tag":56,"props":495,"children":497},{"class":58,"line":496},20,[498,504,508],{"type":19,"tag":56,"props":499,"children":501},{"style":500},"--shiki-default:#FFAB70;--shiki-dark:#FFAB70",[502],{"type":24,"value":503},"                    strategy",{"type":19,"tag":56,"props":505,"children":506},{"style":176},[507],{"type":24,"value":227},{"type":19,"tag":56,"props":509,"children":510},{"style":379},[511],{"type":24,"value":512},"'variable_renaming'\n",{"type":19,"tag":56,"props":514,"children":516},{"class":58,"line":515},21,[517],{"type":19,"tag":56,"props":518,"children":519},{"style":63},[520],{"type":24,"value":521},"                )\n",{"type":19,"tag":56,"props":523,"children":525},{"class":58,"line":524},22,[526],{"type":19,"tag":56,"props":527,"children":528},{"style":63},[529],{"type":24,"value":530},"                augmented_data.append(mutated_code)\n",{"type":19,"tag":56,"props":532,"children":534},{"class":58,"line":533},23,[535],{"type":19,"tag":56,"props":536,"children":537},{"style":63},[538],{"type":24,"value":539},"                \n",{"type":19,"tag":56,"props":541,"children":543},{"class":58,"line":542},24,[544,549],{"type":19,"tag":56,"props":545,"children":546},{"style":176},[547],{"type":24,"value":548},"        return",{"type":19,"tag":56,"props":550,"children":551},{"style":63},[552],{"type":24,"value":553}," augmented_data\n",{"type":19,"tag":27,"props":555,"children":557},{"id":556},"高效微调策略-peft",[558],{"type":24,"value":559},"🔧 高效微调策略 (PEFT)",{"type":19,"tag":34,"props":561,"children":563},{"id":562},"lora-low-rank-adaptation",[564],{"type":24,"value":565},"LoRA (Low-Rank Adaptation)",{"type":19,"tag":20,"props":567,"children":568},{},[569],{"type":24,"value":570},"为了适应不同行业和风格的需求，我们广泛采用 LoRA 技术进行轻量级微调。相比全量微调，LoRA 仅需训练极少量的参数（\u003C1%），即可实现媲美全量微调的效果，且显存占用大幅降低。",{"type":19,"tag":20,"props":572,"children":573},{},[574],{"type":19,"tag":157,"props":575,"children":576},{},[577],{"type":24,"value":578},"LoRA 配置与训练代码",{"type":19,"tag":45,"props":580,"children":582},{"className":164,"code":581,"language":166,"meta":7,"style":7},"from peft import LoraConfig, get_peft_model, TaskType\n\ndef configure_lora_model(base_model):\n    peft_config = LoraConfig(\n        task_type=TaskType.CAUSAL_LM, \n        inference_mode=False, \n        r=8,            # 低秩矩阵的秩\n        lora_alpha=32,  # 缩放系数\n        lora_dropout=0.1,\n        target_modules=[\"q_proj\", \"v_proj\"] # 仅针对 Attention 层的 Q/V 矩阵\n    )\n    \n    model = get_peft_model(base_model, peft_config)\n    model.print_trainable_parameters()\n    \n    return model\n",[583],{"type":19,"tag":52,"props":584,"children":585},{"__ignoreMap":7},[586,609,618,636,653,680,701,728,755,777,819,827,834,851,859,866],{"type":19,"tag":56,"props":587,"children":588},{"class":58,"line":59},[589,594,599,604],{"type":19,"tag":56,"props":590,"children":591},{"style":176},[592],{"type":24,"value":593},"from",{"type":19,"tag":56,"props":595,"children":596},{"style":63},[597],{"type":24,"value":598}," peft ",{"type":19,"tag":56,"props":600,"children":601},{"style":176},[602],{"type":24,"value":603},"import",{"type":19,"tag":56,"props":605,"children":606},{"style":63},[607],{"type":24,"value":608}," LoraConfig, get_peft_model, TaskType\n",{"type":19,"tag":56,"props":610,"children":611},{"class":58,"line":69},[612],{"type":19,"tag":56,"props":613,"children":615},{"emptyLinePlaceholder":614},true,[616],{"type":24,"value":617},"\n",{"type":19,"tag":56,"props":619,"children":620},{"class":58,"line":78},[621,626,631],{"type":19,"tag":56,"props":622,"children":623},{"style":176},[624],{"type":24,"value":625},"def",{"type":19,"tag":56,"props":627,"children":628},{"style":182},[629],{"type":24,"value":630}," configure_lora_model",{"type":19,"tag":56,"props":632,"children":633},{"style":63},[634],{"type":24,"value":635},"(base_model):\n",{"type":19,"tag":56,"props":637,"children":638},{"class":58,"line":87},[639,644,648],{"type":19,"tag":56,"props":640,"children":641},{"style":63},[642],{"type":24,"value":643},"    peft_config ",{"type":19,"tag":56,"props":645,"children":646},{"style":176},[647],{"type":24,"value":227},{"type":19,"tag":56,"props":649,"children":650},{"style":63},[651],{"type":24,"value":652}," LoraConfig(\n",{"type":19,"tag":56,"props":654,"children":655},{"class":58,"line":96},[656,661,665,670,675],{"type":19,"tag":56,"props":657,"children":658},{"style":500},[659],{"type":24,"value":660},"        task_type",{"type":19,"tag":56,"props":662,"children":663},{"style":176},[664],{"type":24,"value":227},{"type":19,"tag":56,"props":666,"children":667},{"style":63},[668],{"type":24,"value":669},"TaskType.",{"type":19,"tag":56,"props":671,"children":672},{"style":201},[673],{"type":24,"value":674},"CAUSAL_LM",{"type":19,"tag":56,"props":676,"children":677},{"style":63},[678],{"type":24,"value":679},", \n",{"type":19,"tag":56,"props":681,"children":682},{"class":58,"line":105},[683,688,692,697],{"type":19,"tag":56,"props":684,"children":685},{"style":500},[686],{"type":24,"value":687},"        inference_mode",{"type":19,"tag":56,"props":689,"children":690},{"style":176},[691],{"type":24,"value":227},{"type":19,"tag":56,"props":693,"children":694},{"style":201},[695],{"type":24,"value":696},"False",{"type":19,"tag":56,"props":698,"children":699},{"style":63},[700],{"type":24,"value":679},{"type":19,"tag":56,"props":702,"children":703},{"class":58,"line":114},[704,709,713,718,723],{"type":19,"tag":56,"props":705,"children":706},{"style":500},[707],{"type":24,"value":708},"        r",{"type":19,"tag":56,"props":710,"children":711},{"style":176},[712],{"type":24,"value":227},{"type":19,"tag":56,"props":714,"children":715},{"style":201},[716],{"type":24,"value":717},"8",{"type":19,"tag":56,"props":719,"children":720},{"style":63},[721],{"type":24,"value":722},",            ",{"type":19,"tag":56,"props":724,"children":725},{"style":354},[726],{"type":24,"value":727},"# 低秩矩阵的秩\n",{"type":19,"tag":56,"props":729,"children":730},{"class":58,"line":123},[731,736,740,745,750],{"type":19,"tag":56,"props":732,"children":733},{"style":500},[734],{"type":24,"value":735},"        lora_alpha",{"type":19,"tag":56,"props":737,"children":738},{"style":176},[739],{"type":24,"value":227},{"type":19,"tag":56,"props":741,"children":742},{"style":201},[743],{"type":24,"value":744},"32",{"type":19,"tag":56,"props":746,"children":747},{"style":63},[748],{"type":24,"value":749},",  ",{"type":19,"tag":56,"props":751,"children":752},{"style":354},[753],{"type":24,"value":754},"# 缩放系数\n",{"type":19,"tag":56,"props":756,"children":757},{"class":58,"line":132},[758,763,767,772],{"type":19,"tag":56,"props":759,"children":760},{"style":500},[761],{"type":24,"value":762},"        lora_dropout",{"type":19,"tag":56,"props":764,"children":765},{"style":176},[766],{"type":24,"value":227},{"type":19,"tag":56,"props":768,"children":769},{"style":201},[770],{"type":24,"value":771},"0.1",{"type":19,"tag":56,"props":773,"children":774},{"style":63},[775],{"type":24,"value":776},",\n",{"type":19,"tag":56,"props":778,"children":779},{"class":58,"line":141},[780,785,789,794,799,804,809,814],{"type":19,"tag":56,"props":781,"children":782},{"style":500},[783],{"type":24,"value":784},"        target_modules",{"type":19,"tag":56,"props":786,"children":787},{"style":176},[788],{"type":24,"value":227},{"type":19,"tag":56,"props":790,"children":791},{"style":63},[792],{"type":24,"value":793},"[",{"type":19,"tag":56,"props":795,"children":796},{"style":379},[797],{"type":24,"value":798},"\"q_proj\"",{"type":19,"tag":56,"props":800,"children":801},{"style":63},[802],{"type":24,"value":803},", ",{"type":19,"tag":56,"props":805,"children":806},{"style":379},[807],{"type":24,"value":808},"\"v_proj\"",{"type":19,"tag":56,"props":810,"children":811},{"style":63},[812],{"type":24,"value":813},"] ",{"type":19,"tag":56,"props":815,"children":816},{"style":354},[817],{"type":24,"value":818},"# 仅针对 Attention 层的 Q/V 矩阵\n",{"type":19,"tag":56,"props":820,"children":821},{"class":58,"line":350},[822],{"type":19,"tag":56,"props":823,"children":824},{"style":63},[825],{"type":24,"value":826},"    )\n",{"type":19,"tag":56,"props":828,"children":829},{"class":58,"line":360},[830],{"type":19,"tag":56,"props":831,"children":832},{"style":63},[833],{"type":24,"value":282},{"type":19,"tag":56,"props":835,"children":836},{"class":58,"line":389},[837,842,846],{"type":19,"tag":56,"props":838,"children":839},{"style":63},[840],{"type":24,"value":841},"    model ",{"type":19,"tag":56,"props":843,"children":844},{"style":176},[845],{"type":24,"value":227},{"type":19,"tag":56,"props":847,"children":848},{"style":63},[849],{"type":24,"value":850}," get_peft_model(base_model, peft_config)\n",{"type":19,"tag":56,"props":852,"children":853},{"class":58,"line":412},[854],{"type":19,"tag":56,"props":855,"children":856},{"style":63},[857],{"type":24,"value":858},"    model.print_trainable_parameters()\n",{"type":19,"tag":56,"props":860,"children":861},{"class":58,"line":421},[862],{"type":19,"tag":56,"props":863,"children":864},{"style":63},[865],{"type":24,"value":282},{"type":19,"tag":56,"props":867,"children":868},{"class":58,"line":430},[869,874],{"type":19,"tag":56,"props":870,"children":871},{"style":176},[872],{"type":24,"value":873},"    return",{"type":19,"tag":56,"props":875,"children":876},{"style":63},[877],{"type":24,"value":878}," model\n",{"type":19,"tag":34,"props":880,"children":882},{"id":881},"多任务指令微调",[883],{"type":24,"value":881},{"type":19,"tag":20,"props":885,"children":886},{},[887],{"type":24,"value":888},"我们将网页生成任务拆解为多个子任务（如：HTML 结构生成、CSS 样式生成、文案创作、交互逻辑编写），通过多任务指令微调（Multi-task Instruction Tuning）提升模型的通用能力。",{"type":19,"tag":890,"props":891,"children":892},"ul",{},[893,904],{"type":19,"tag":894,"props":895,"children":896},"li",{},[897,902],{"type":19,"tag":157,"props":898,"children":899},{},[900],{"type":24,"value":901},"任务混合比例",{"type":24,"value":903},"：代码生成 (40%) + 设计描述理解 (30%) + 文案创作 (20%) + 逻辑推理 (10%)。",{"type":19,"tag":894,"props":905,"children":906},{},[907,912,914,920],{"type":19,"tag":157,"props":908,"children":909},{},[910],{"type":24,"value":911},"Prompt 模板化",{"type":24,"value":913},"：统一构建 ",{"type":19,"tag":52,"props":915,"children":917},{"className":916},[],[918],{"type":24,"value":919},"\u003CInstruction> + \u003CInput> + \u003COutput>",{"type":24,"value":921}," 的训练样本格式。",{"type":19,"tag":27,"props":923,"children":925},{"id":924},"训练性能优化",[926],{"type":24,"value":927},"🚀 训练性能优化",{"type":19,"tag":34,"props":929,"children":931},{"id":930},"分布式训练架构",[932],{"type":24,"value":930},{"type":19,"tag":20,"props":934,"children":935},{},[936],{"type":24,"value":937},"针对百亿级参数的大模型，单机显存无法满足需求。我们采用 DeepSpeed + PyTorch Lightning 构建分布式训练集群。",{"type":19,"tag":890,"props":939,"children":940},{},[941,951],{"type":19,"tag":894,"props":942,"children":943},{},[944,949],{"type":19,"tag":157,"props":945,"children":946},{},[947],{"type":24,"value":948},"ZeRO Stage 3",{"type":24,"value":950},"：将优化器状态、梯度和模型参数切分到不同 GPU 上，极大降低单卡显存压力。",{"type":19,"tag":894,"props":952,"children":953},{},[954,959],{"type":19,"tag":157,"props":955,"children":956},{},[957],{"type":24,"value":958},"混合精度训练 (Mixed Precision)",{"type":24,"value":960},"：使用 FP16/BF16 进行计算，FP32 进行权重更新，加速训练并减少显存占用。",{"type":19,"tag":20,"props":962,"children":963},{},[964],{"type":19,"tag":157,"props":965,"children":966},{},[967],{"type":24,"value":968},"DeepSpeed 配置示例",{"type":19,"tag":45,"props":970,"children":974},{"className":971,"code":972,"language":973,"meta":7,"style":7},"language-json shiki shiki-themes github-dark github-dark","{\n  \"fp16\": {\n    \"enabled\": true,\n    \"loss_scale\": 0,\n    \"loss_scale_window\": 1000,\n    \"initial_scale_power\": 16,\n    \"hysteresis\": 2,\n    \"min_loss_scale\": 1\n  },\n  \"optimizer\": {\n    \"type\": \"AdamW\",\n    \"params\": {\n      \"lr\": \"auto\",\n      \"betas\": \"auto\",\n      \"eps\": \"auto\",\n      \"weight_decay\": \"auto\"\n    }\n  },\n  \"zero_optimization\": {\n    \"stage\": 3,\n    \"offload_optimizer\": {\n      \"device\": \"cpu\",\n      \"pin_memory\": true\n    },\n    \"offload_param\": {\n      \"device\": \"cpu\",\n      \"pin_memory\": true\n    }\n  }\n}\n","json",[975],{"type":19,"tag":52,"props":976,"children":977},{"__ignoreMap":7},[978,986,999,1021,1042,1063,1084,1105,1122,1130,1142,1163,1175,1196,1216,1236,1253,1261,1268,1280,1301,1313,1334,1351,1359,1372,1392,1408,1416,1425],{"type":19,"tag":56,"props":979,"children":980},{"class":58,"line":59},[981],{"type":19,"tag":56,"props":982,"children":983},{"style":63},[984],{"type":24,"value":985},"{\n",{"type":19,"tag":56,"props":987,"children":988},{"class":58,"line":69},[989,994],{"type":19,"tag":56,"props":990,"children":991},{"style":201},[992],{"type":24,"value":993},"  \"fp16\"",{"type":19,"tag":56,"props":995,"children":996},{"style":63},[997],{"type":24,"value":998},": {\n",{"type":19,"tag":56,"props":1000,"children":1001},{"class":58,"line":78},[1002,1007,1012,1017],{"type":19,"tag":56,"props":1003,"children":1004},{"style":201},[1005],{"type":24,"value":1006},"    \"enabled\"",{"type":19,"tag":56,"props":1008,"children":1009},{"style":63},[1010],{"type":24,"value":1011},": ",{"type":19,"tag":56,"props":1013,"children":1014},{"style":201},[1015],{"type":24,"value":1016},"true",{"type":19,"tag":56,"props":1018,"children":1019},{"style":63},[1020],{"type":24,"value":776},{"type":19,"tag":56,"props":1022,"children":1023},{"class":58,"line":87},[1024,1029,1033,1038],{"type":19,"tag":56,"props":1025,"children":1026},{"style":201},[1027],{"type":24,"value":1028},"    \"loss_scale\"",{"type":19,"tag":56,"props":1030,"children":1031},{"style":63},[1032],{"type":24,"value":1011},{"type":19,"tag":56,"props":1034,"children":1035},{"style":201},[1036],{"type":24,"value":1037},"0",{"type":19,"tag":56,"props":1039,"children":1040},{"style":63},[1041],{"type":24,"value":776},{"type":19,"tag":56,"props":1043,"children":1044},{"class":58,"line":96},[1045,1050,1054,1059],{"type":19,"tag":56,"props":1046,"children":1047},{"style":201},[1048],{"type":24,"value":1049},"    \"loss_scale_window\"",{"type":19,"tag":56,"props":1051,"children":1052},{"style":63},[1053],{"type":24,"value":1011},{"type":19,"tag":56,"props":1055,"children":1056},{"style":201},[1057],{"type":24,"value":1058},"1000",{"type":19,"tag":56,"props":1060,"children":1061},{"style":63},[1062],{"type":24,"value":776},{"type":19,"tag":56,"props":1064,"children":1065},{"class":58,"line":105},[1066,1071,1075,1080],{"type":19,"tag":56,"props":1067,"children":1068},{"style":201},[1069],{"type":24,"value":1070},"    \"initial_scale_power\"",{"type":19,"tag":56,"props":1072,"children":1073},{"style":63},[1074],{"type":24,"value":1011},{"type":19,"tag":56,"props":1076,"children":1077},{"style":201},[1078],{"type":24,"value":1079},"16",{"type":19,"tag":56,"props":1081,"children":1082},{"style":63},[1083],{"type":24,"value":776},{"type":19,"tag":56,"props":1085,"children":1086},{"class":58,"line":114},[1087,1092,1096,1101],{"type":19,"tag":56,"props":1088,"children":1089},{"style":201},[1090],{"type":24,"value":1091},"    \"hysteresis\"",{"type":19,"tag":56,"props":1093,"children":1094},{"style":63},[1095],{"type":24,"value":1011},{"type":19,"tag":56,"props":1097,"children":1098},{"style":201},[1099],{"type":24,"value":1100},"2",{"type":19,"tag":56,"props":1102,"children":1103},{"style":63},[1104],{"type":24,"value":776},{"type":19,"tag":56,"props":1106,"children":1107},{"class":58,"line":123},[1108,1113,1117],{"type":19,"tag":56,"props":1109,"children":1110},{"style":201},[1111],{"type":24,"value":1112},"    \"min_loss_scale\"",{"type":19,"tag":56,"props":1114,"children":1115},{"style":63},[1116],{"type":24,"value":1011},{"type":19,"tag":56,"props":1118,"children":1119},{"style":201},[1120],{"type":24,"value":1121},"1\n",{"type":19,"tag":56,"props":1123,"children":1124},{"class":58,"line":132},[1125],{"type":19,"tag":56,"props":1126,"children":1127},{"style":63},[1128],{"type":24,"value":1129},"  },\n",{"type":19,"tag":56,"props":1131,"children":1132},{"class":58,"line":141},[1133,1138],{"type":19,"tag":56,"props":1134,"children":1135},{"style":201},[1136],{"type":24,"value":1137},"  \"optimizer\"",{"type":19,"tag":56,"props":1139,"children":1140},{"style":63},[1141],{"type":24,"value":998},{"type":19,"tag":56,"props":1143,"children":1144},{"class":58,"line":350},[1145,1150,1154,1159],{"type":19,"tag":56,"props":1146,"children":1147},{"style":201},[1148],{"type":24,"value":1149},"    \"type\"",{"type":19,"tag":56,"props":1151,"children":1152},{"style":63},[1153],{"type":24,"value":1011},{"type":19,"tag":56,"props":1155,"children":1156},{"style":379},[1157],{"type":24,"value":1158},"\"AdamW\"",{"type":19,"tag":56,"props":1160,"children":1161},{"style":63},[1162],{"type":24,"value":776},{"type":19,"tag":56,"props":1164,"children":1165},{"class":58,"line":360},[1166,1171],{"type":19,"tag":56,"props":1167,"children":1168},{"style":201},[1169],{"type":24,"value":1170},"    \"params\"",{"type":19,"tag":56,"props":1172,"children":1173},{"style":63},[1174],{"type":24,"value":998},{"type":19,"tag":56,"props":1176,"children":1177},{"class":58,"line":389},[1178,1183,1187,1192],{"type":19,"tag":56,"props":1179,"children":1180},{"style":201},[1181],{"type":24,"value":1182},"      \"lr\"",{"type":19,"tag":56,"props":1184,"children":1185},{"style":63},[1186],{"type":24,"value":1011},{"type":19,"tag":56,"props":1188,"children":1189},{"style":379},[1190],{"type":24,"value":1191},"\"auto\"",{"type":19,"tag":56,"props":1193,"children":1194},{"style":63},[1195],{"type":24,"value":776},{"type":19,"tag":56,"props":1197,"children":1198},{"class":58,"line":412},[1199,1204,1208,1212],{"type":19,"tag":56,"props":1200,"children":1201},{"style":201},[1202],{"type":24,"value":1203},"      \"betas\"",{"type":19,"tag":56,"props":1205,"children":1206},{"style":63},[1207],{"type":24,"value":1011},{"type":19,"tag":56,"props":1209,"children":1210},{"style":379},[1211],{"type":24,"value":1191},{"type":19,"tag":56,"props":1213,"children":1214},{"style":63},[1215],{"type":24,"value":776},{"type":19,"tag":56,"props":1217,"children":1218},{"class":58,"line":421},[1219,1224,1228,1232],{"type":19,"tag":56,"props":1220,"children":1221},{"style":201},[1222],{"type":24,"value":1223},"      \"eps\"",{"type":19,"tag":56,"props":1225,"children":1226},{"style":63},[1227],{"type":24,"value":1011},{"type":19,"tag":56,"props":1229,"children":1230},{"style":379},[1231],{"type":24,"value":1191},{"type":19,"tag":56,"props":1233,"children":1234},{"style":63},[1235],{"type":24,"value":776},{"type":19,"tag":56,"props":1237,"children":1238},{"class":58,"line":430},[1239,1244,1248],{"type":19,"tag":56,"props":1240,"children":1241},{"style":201},[1242],{"type":24,"value":1243},"      \"weight_decay\"",{"type":19,"tag":56,"props":1245,"children":1246},{"style":63},[1247],{"type":24,"value":1011},{"type":19,"tag":56,"props":1249,"children":1250},{"style":379},[1251],{"type":24,"value":1252},"\"auto\"\n",{"type":19,"tag":56,"props":1254,"children":1255},{"class":58,"line":439},[1256],{"type":19,"tag":56,"props":1257,"children":1258},{"style":63},[1259],{"type":24,"value":1260},"    }\n",{"type":19,"tag":56,"props":1262,"children":1263},{"class":58,"line":465},[1264],{"type":19,"tag":56,"props":1265,"children":1266},{"style":63},[1267],{"type":24,"value":1129},{"type":19,"tag":56,"props":1269,"children":1270},{"class":58,"line":487},[1271,1276],{"type":19,"tag":56,"props":1272,"children":1273},{"style":201},[1274],{"type":24,"value":1275},"  \"zero_optimization\"",{"type":19,"tag":56,"props":1277,"children":1278},{"style":63},[1279],{"type":24,"value":998},{"type":19,"tag":56,"props":1281,"children":1282},{"class":58,"line":496},[1283,1288,1292,1297],{"type":19,"tag":56,"props":1284,"children":1285},{"style":201},[1286],{"type":24,"value":1287},"    \"stage\"",{"type":19,"tag":56,"props":1289,"children":1290},{"style":63},[1291],{"type":24,"value":1011},{"type":19,"tag":56,"props":1293,"children":1294},{"style":201},[1295],{"type":24,"value":1296},"3",{"type":19,"tag":56,"props":1298,"children":1299},{"style":63},[1300],{"type":24,"value":776},{"type":19,"tag":56,"props":1302,"children":1303},{"class":58,"line":515},[1304,1309],{"type":19,"tag":56,"props":1305,"children":1306},{"style":201},[1307],{"type":24,"value":1308},"    \"offload_optimizer\"",{"type":19,"tag":56,"props":1310,"children":1311},{"style":63},[1312],{"type":24,"value":998},{"type":19,"tag":56,"props":1314,"children":1315},{"class":58,"line":524},[1316,1321,1325,1330],{"type":19,"tag":56,"props":1317,"children":1318},{"style":201},[1319],{"type":24,"value":1320},"      \"device\"",{"type":19,"tag":56,"props":1322,"children":1323},{"style":63},[1324],{"type":24,"value":1011},{"type":19,"tag":56,"props":1326,"children":1327},{"style":379},[1328],{"type":24,"value":1329},"\"cpu\"",{"type":19,"tag":56,"props":1331,"children":1332},{"style":63},[1333],{"type":24,"value":776},{"type":19,"tag":56,"props":1335,"children":1336},{"class":58,"line":533},[1337,1342,1346],{"type":19,"tag":56,"props":1338,"children":1339},{"style":201},[1340],{"type":24,"value":1341},"      \"pin_memory\"",{"type":19,"tag":56,"props":1343,"children":1344},{"style":63},[1345],{"type":24,"value":1011},{"type":19,"tag":56,"props":1347,"children":1348},{"style":201},[1349],{"type":24,"value":1350},"true\n",{"type":19,"tag":56,"props":1352,"children":1353},{"class":58,"line":542},[1354],{"type":19,"tag":56,"props":1355,"children":1356},{"style":63},[1357],{"type":24,"value":1358},"    },\n",{"type":19,"tag":56,"props":1360,"children":1362},{"class":58,"line":1361},25,[1363,1368],{"type":19,"tag":56,"props":1364,"children":1365},{"style":201},[1366],{"type":24,"value":1367},"    \"offload_param\"",{"type":19,"tag":56,"props":1369,"children":1370},{"style":63},[1371],{"type":24,"value":998},{"type":19,"tag":56,"props":1373,"children":1375},{"class":58,"line":1374},26,[1376,1380,1384,1388],{"type":19,"tag":56,"props":1377,"children":1378},{"style":201},[1379],{"type":24,"value":1320},{"type":19,"tag":56,"props":1381,"children":1382},{"style":63},[1383],{"type":24,"value":1011},{"type":19,"tag":56,"props":1385,"children":1386},{"style":379},[1387],{"type":24,"value":1329},{"type":19,"tag":56,"props":1389,"children":1390},{"style":63},[1391],{"type":24,"value":776},{"type":19,"tag":56,"props":1393,"children":1395},{"class":58,"line":1394},27,[1396,1400,1404],{"type":19,"tag":56,"props":1397,"children":1398},{"style":201},[1399],{"type":24,"value":1341},{"type":19,"tag":56,"props":1401,"children":1402},{"style":63},[1403],{"type":24,"value":1011},{"type":19,"tag":56,"props":1405,"children":1406},{"style":201},[1407],{"type":24,"value":1350},{"type":19,"tag":56,"props":1409,"children":1411},{"class":58,"line":1410},28,[1412],{"type":19,"tag":56,"props":1413,"children":1414},{"style":63},[1415],{"type":24,"value":1260},{"type":19,"tag":56,"props":1417,"children":1419},{"class":58,"line":1418},29,[1420],{"type":19,"tag":56,"props":1421,"children":1422},{"style":63},[1423],{"type":24,"value":1424},"  }\n",{"type":19,"tag":56,"props":1426,"children":1428},{"class":58,"line":1427},30,[1429],{"type":19,"tag":56,"props":1430,"children":1431},{"style":63},[1432],{"type":24,"value":1433},"}\n",{"type":19,"tag":34,"props":1435,"children":1437},{"id":1436},"模型量化与推理加速",[1438],{"type":24,"value":1436},{"type":19,"tag":20,"props":1440,"children":1441},{},[1442],{"type":24,"value":1443},"在部署阶段，我们使用量化技术进一步压缩模型体积，提升推理速度。",{"type":19,"tag":890,"props":1445,"children":1446},{},[1447,1457],{"type":19,"tag":894,"props":1448,"children":1449},{},[1450,1455],{"type":19,"tag":157,"props":1451,"children":1452},{},[1453],{"type":24,"value":1454},"GPTQ / AWQ 量化",{"type":24,"value":1456},"：将权重从 FP16 量化为 INT4，模型体积减少 75%，推理速度提升 3-4 倍，精度损失微乎其微。",{"type":19,"tag":894,"props":1458,"children":1459},{},[1460,1465],{"type":19,"tag":157,"props":1461,"children":1462},{},[1463],{"type":24,"value":1464},"vLLM 推理引擎",{"type":24,"value":1466},"：利用 PagedAttention 技术优化显存管理，显著提升并发吞吐量。",{"type":19,"tag":27,"props":1468,"children":1470},{"id":1469},"持续学习与反馈闭环-rlhf",[1471],{"type":24,"value":1472},"🔄 持续学习与反馈闭环 (RLHF)",{"type":19,"tag":34,"props":1474,"children":1476},{"id":1475},"基于人类反馈的强化学习",[1477],{"type":24,"value":1475},{"type":19,"tag":20,"props":1479,"children":1480},{},[1481],{"type":24,"value":1482},"为了让模型生成的网页更符合人类审美和实用标准，我们引入了 RLHF (Reinforcement Learning from Human Feedback) 机制。",{"type":19,"tag":1484,"props":1485,"children":1486},"ol",{},[1487,1497],{"type":19,"tag":894,"props":1488,"children":1489},{},[1490,1495],{"type":19,"tag":157,"props":1491,"children":1492},{},[1493],{"type":24,"value":1494},"奖励模型 (Reward Model) 训练",{"type":24,"value":1496},"：收集人类专家对生成结果的排序数据（A 优于 B），训练一个打分模型。",{"type":19,"tag":894,"props":1498,"children":1499},{},[1500,1505],{"type":19,"tag":157,"props":1501,"children":1502},{},[1503],{"type":24,"value":1504},"PPO 强化学习",{"type":24,"value":1506},"：使用奖励模型作为环境反馈，通过 PPO (Proximal Policy Optimization) 算法优化生成模型，使其倾向于生成高分结果。",{"type":19,"tag":20,"props":1508,"children":1509},{},[1510],{"type":19,"tag":157,"props":1511,"children":1512},{},[1513],{"type":24,"value":1514},"奖励函数设计",{"type":19,"tag":45,"props":1516,"children":1518},{"className":164,"code":1517,"language":166,"meta":7,"style":7},"def calculate_reward(generated_page, user_feedback):\n    # 基础质量分 (代码无误、结构完整)\n    base_score = static_analysis_score(generated_page)\n    \n    # 美学评分 (AI 视觉评估)\n    aesthetic_score = aesthetic_model.predict(generated_page.screenshot)\n    \n    # 用户满意度 (点击率、停留时长、直接评分)\n    user_score = normalize(user_feedback.rating)\n    \n    # 综合奖励\n    final_reward = 0.4 * base_score + 0.3 * aesthetic_score + 0.3 * user_score\n    return final_reward\n",[1519],{"type":19,"tag":52,"props":1520,"children":1521},{"__ignoreMap":7},[1522,1539,1547,1564,1571,1579,1596,1603,1611,1628,1635,1643,1706],{"type":19,"tag":56,"props":1523,"children":1524},{"class":58,"line":59},[1525,1529,1534],{"type":19,"tag":56,"props":1526,"children":1527},{"style":176},[1528],{"type":24,"value":625},{"type":19,"tag":56,"props":1530,"children":1531},{"style":182},[1532],{"type":24,"value":1533}," calculate_reward",{"type":19,"tag":56,"props":1535,"children":1536},{"style":63},[1537],{"type":24,"value":1538},"(generated_page, user_feedback):\n",{"type":19,"tag":56,"props":1540,"children":1541},{"class":58,"line":69},[1542],{"type":19,"tag":56,"props":1543,"children":1544},{"style":354},[1545],{"type":24,"value":1546},"    # 基础质量分 (代码无误、结构完整)\n",{"type":19,"tag":56,"props":1548,"children":1549},{"class":58,"line":78},[1550,1555,1559],{"type":19,"tag":56,"props":1551,"children":1552},{"style":63},[1553],{"type":24,"value":1554},"    base_score ",{"type":19,"tag":56,"props":1556,"children":1557},{"style":176},[1558],{"type":24,"value":227},{"type":19,"tag":56,"props":1560,"children":1561},{"style":63},[1562],{"type":24,"value":1563}," static_analysis_score(generated_page)\n",{"type":19,"tag":56,"props":1565,"children":1566},{"class":58,"line":87},[1567],{"type":19,"tag":56,"props":1568,"children":1569},{"style":63},[1570],{"type":24,"value":282},{"type":19,"tag":56,"props":1572,"children":1573},{"class":58,"line":96},[1574],{"type":19,"tag":56,"props":1575,"children":1576},{"style":354},[1577],{"type":24,"value":1578},"    # 美学评分 (AI 视觉评估)\n",{"type":19,"tag":56,"props":1580,"children":1581},{"class":58,"line":105},[1582,1587,1591],{"type":19,"tag":56,"props":1583,"children":1584},{"style":63},[1585],{"type":24,"value":1586},"    aesthetic_score ",{"type":19,"tag":56,"props":1588,"children":1589},{"style":176},[1590],{"type":24,"value":227},{"type":19,"tag":56,"props":1592,"children":1593},{"style":63},[1594],{"type":24,"value":1595}," aesthetic_model.predict(generated_page.screenshot)\n",{"type":19,"tag":56,"props":1597,"children":1598},{"class":58,"line":114},[1599],{"type":19,"tag":56,"props":1600,"children":1601},{"style":63},[1602],{"type":24,"value":282},{"type":19,"tag":56,"props":1604,"children":1605},{"class":58,"line":123},[1606],{"type":19,"tag":56,"props":1607,"children":1608},{"style":354},[1609],{"type":24,"value":1610},"    # 用户满意度 (点击率、停留时长、直接评分)\n",{"type":19,"tag":56,"props":1612,"children":1613},{"class":58,"line":132},[1614,1619,1623],{"type":19,"tag":56,"props":1615,"children":1616},{"style":63},[1617],{"type":24,"value":1618},"    user_score ",{"type":19,"tag":56,"props":1620,"children":1621},{"style":176},[1622],{"type":24,"value":227},{"type":19,"tag":56,"props":1624,"children":1625},{"style":63},[1626],{"type":24,"value":1627}," normalize(user_feedback.rating)\n",{"type":19,"tag":56,"props":1629,"children":1630},{"class":58,"line":141},[1631],{"type":19,"tag":56,"props":1632,"children":1633},{"style":63},[1634],{"type":24,"value":282},{"type":19,"tag":56,"props":1636,"children":1637},{"class":58,"line":350},[1638],{"type":19,"tag":56,"props":1639,"children":1640},{"style":354},[1641],{"type":24,"value":1642},"    # 综合奖励\n",{"type":19,"tag":56,"props":1644,"children":1645},{"class":58,"line":360},[1646,1651,1655,1660,1665,1670,1675,1680,1684,1689,1693,1697,1701],{"type":19,"tag":56,"props":1647,"children":1648},{"style":63},[1649],{"type":24,"value":1650},"    final_reward ",{"type":19,"tag":56,"props":1652,"children":1653},{"style":176},[1654],{"type":24,"value":227},{"type":19,"tag":56,"props":1656,"children":1657},{"style":201},[1658],{"type":24,"value":1659}," 0.4",{"type":19,"tag":56,"props":1661,"children":1662},{"style":176},[1663],{"type":24,"value":1664}," *",{"type":19,"tag":56,"props":1666,"children":1667},{"style":63},[1668],{"type":24,"value":1669}," base_score ",{"type":19,"tag":56,"props":1671,"children":1672},{"style":176},[1673],{"type":24,"value":1674},"+",{"type":19,"tag":56,"props":1676,"children":1677},{"style":201},[1678],{"type":24,"value":1679}," 0.3",{"type":19,"tag":56,"props":1681,"children":1682},{"style":176},[1683],{"type":24,"value":1664},{"type":19,"tag":56,"props":1685,"children":1686},{"style":63},[1687],{"type":24,"value":1688}," aesthetic_score ",{"type":19,"tag":56,"props":1690,"children":1691},{"style":176},[1692],{"type":24,"value":1674},{"type":19,"tag":56,"props":1694,"children":1695},{"style":201},[1696],{"type":24,"value":1679},{"type":19,"tag":56,"props":1698,"children":1699},{"style":176},[1700],{"type":24,"value":1664},{"type":19,"tag":56,"props":1702,"children":1703},{"style":63},[1704],{"type":24,"value":1705}," user_score\n",{"type":19,"tag":56,"props":1707,"children":1708},{"class":58,"line":389},[1709,1713],{"type":19,"tag":56,"props":1710,"children":1711},{"style":176},[1712],{"type":24,"value":873},{"type":19,"tag":56,"props":1714,"children":1715},{"style":63},[1716],{"type":24,"value":1717}," final_reward\n",{"type":19,"tag":34,"props":1719,"children":1721},{"id":1720},"在线学习系统",[1722],{"type":24,"value":1720},{"type":19,"tag":20,"props":1724,"children":1725},{},[1726],{"type":24,"value":1727},"系统会自动收集用户的修改行为（如：用户手动修改了生成的颜色或布局），将其转化为新的训练样本，定期触发增量训练，实现模型的自我进化。",{"type":19,"tag":27,"props":1729,"children":1731},{"id":1730},"评估指标体系",[1732],{"type":24,"value":1733},"📊 评估指标体系",{"type":19,"tag":20,"props":1735,"children":1736},{},[1737],{"type":24,"value":1738},"我们建立了一套多维度的评估指标，用于监控模型的训练效果。",{"type":19,"tag":1740,"props":1741,"children":1742},"table",{},[1743,1767],{"type":19,"tag":1744,"props":1745,"children":1746},"thead",{},[1747],{"type":19,"tag":1748,"props":1749,"children":1750},"tr",{},[1751,1757,1762],{"type":19,"tag":1752,"props":1753,"children":1754},"th",{},[1755],{"type":24,"value":1756},"维度",{"type":19,"tag":1752,"props":1758,"children":1759},{},[1760],{"type":24,"value":1761},"指标",{"type":19,"tag":1752,"props":1763,"children":1764},{},[1765],{"type":24,"value":1766},"说明",{"type":19,"tag":1768,"props":1769,"children":1770},"tbody",{},[1771,1793,1814,1835],{"type":19,"tag":1748,"props":1772,"children":1773},{},[1774,1783,1788],{"type":19,"tag":1775,"props":1776,"children":1777},"td",{},[1778],{"type":19,"tag":157,"props":1779,"children":1780},{},[1781],{"type":24,"value":1782},"代码质量",{"type":19,"tag":1775,"props":1784,"children":1785},{},[1786],{"type":24,"value":1787},"Pass@k",{"type":19,"tag":1775,"props":1789,"children":1790},{},[1791],{"type":24,"value":1792},"生成代码通过单元测试的概率",{"type":19,"tag":1748,"props":1794,"children":1795},{},[1796,1804,1809],{"type":19,"tag":1775,"props":1797,"children":1798},{},[1799],{"type":19,"tag":157,"props":1800,"children":1801},{},[1802],{"type":24,"value":1803},"语义一致性",{"type":19,"tag":1775,"props":1805,"children":1806},{},[1807],{"type":24,"value":1808},"BERTScore",{"type":19,"tag":1775,"props":1810,"children":1811},{},[1812],{"type":24,"value":1813},"生成内容与 Prompt 的语义相似度",{"type":19,"tag":1748,"props":1815,"children":1816},{},[1817,1825,1830],{"type":19,"tag":1775,"props":1818,"children":1819},{},[1820],{"type":19,"tag":157,"props":1821,"children":1822},{},[1823],{"type":24,"value":1824},"多样性",{"type":19,"tag":1775,"props":1826,"children":1827},{},[1828],{"type":24,"value":1829},"Self-BLEU",{"type":19,"tag":1775,"props":1831,"children":1832},{},[1833],{"type":24,"value":1834},"生成样本之间的差异性（越低越好）",{"type":19,"tag":1748,"props":1836,"children":1837},{},[1838,1846,1851],{"type":19,"tag":1775,"props":1839,"children":1840},{},[1841],{"type":19,"tag":157,"props":1842,"children":1843},{},[1844],{"type":24,"value":1845},"人类偏好",{"type":19,"tag":1775,"props":1847,"children":1848},{},[1849],{"type":24,"value":1850},"Elo Rating",{"type":19,"tag":1775,"props":1852,"children":1853},{},[1854],{"type":24,"value":1855},"基于人类两两比较的胜率排名",{"type":19,"tag":27,"props":1857,"children":1859},{"id":1858},"相关技术文档",[1860],{"type":24,"value":1861},"🔗 相关技术文档",{"type":19,"tag":890,"props":1863,"children":1864},{},[1865,1875,1884],{"type":19,"tag":894,"props":1866,"children":1867},{},[1868],{"type":19,"tag":1869,"props":1870,"children":1872},"a",{"href":1871},"/ai/nlp-technology.md",[1873],{"type":24,"value":1874},"NLP 技术基础",{"type":19,"tag":894,"props":1876,"children":1877},{},[1878],{"type":19,"tag":1869,"props":1879,"children":1881},{"href":1880},"/ai/quality-assurance.md",[1882],{"type":24,"value":1883},"质量保证体系",{"type":19,"tag":894,"props":1885,"children":1886},{},[1887],{"type":19,"tag":1869,"props":1888,"children":1890},{"href":1889},"/ai/content-generation-engine.md",[1891],{"type":24,"value":1892},"内容生成引擎",{"type":19,"tag":1894,"props":1895,"children":1896},"hr",{},[],{"type":19,"tag":20,"props":1898,"children":1899},{},[1900],{"type":19,"tag":1901,"props":1902,"children":1903},"em",{},[1904],{"type":24,"value":1905},"训练优化是 AI 的引擎。HTMLPAGE 通过持续的技术投入，确保我们的模型始终处于行业领先水平。",{"type":19,"tag":1907,"props":1908,"children":1909},"style",{},[1910],{"type":24,"value":1911},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":7,"searchDepth":78,"depth":78,"links":1913},[1914,1918,1922,1926,1930,1931],{"id":29,"depth":69,"text":32,"children":1915},[1916,1917],{"id":36,"depth":78,"text":36},{"id":150,"depth":78,"text":150},{"id":556,"depth":69,"text":559,"children":1919},[1920,1921],{"id":562,"depth":78,"text":565},{"id":881,"depth":78,"text":881},{"id":924,"depth":69,"text":927,"children":1923},[1924,1925],{"id":930,"depth":78,"text":930},{"id":1436,"depth":78,"text":1436},{"id":1469,"depth":69,"text":1472,"children":1927},[1928,1929],{"id":1475,"depth":78,"text":1475},{"id":1720,"depth":78,"text":1720},{"id":1730,"depth":69,"text":1733},{"id":1858,"depth":69,"text":1861},"markdown","content:ai:training-optimization.md","content","ai/training-optimization.md","ai/training-optimization","md",[1939,1950,1959],{"_path":1940,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":1941,"description":1942,"keywords":1943,"schemaType":1944,"author":11,"date":1945,"image":1946,"_type":1932,"_id":1947,"_source":1934,"_file":1948,"_stem":1949,"_extension":1937},"/ai/architecture-overview","AI架构概述 - HTMLPAGE智能网页生成系统","HTMLPAGE AI系统架构深度解析，了解多智能体协作、实时流式生成、模块化组装等核心技术，探索AI如何革新网页设计流程。","AI网页生成, 多智能体系统, 实时流式AI, 智能网页设计, AI架构, 机器学习","TechArticle","2025-11-24","/content-images/ai/architecture-overview.jpg","content:ai:architecture-overview.md","ai/architecture-overview.md","ai/architecture-overview",{"_path":1951,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":1952,"description":1953,"keywords":1954,"author":11,"date":12,"category":1955,"image":14,"_type":1932,"_id":1956,"_source":1934,"_file":1957,"_stem":1958,"_extension":1937},"/ai/batch-creation","批量页面创建","模板 + 提示词模式组合进行多页面高效率生成","批量页面创建, 批量生成, 提示词模板, HTMLPAGE","应用场景","content:ai:batch-creation.md","ai/batch-creation.md","ai/batch-creation",{"_path":1960,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":1961,"description":1962,"keywords":1963,"author":11,"date":12,"category":1964,"image":14,"_type":1932,"_id":1965,"_source":1934,"_file":1966,"_stem":1967,"_extension":1937},"/ai/case-studies","AI 案例研究","HTMLPAGE AI 在不同行业和场景中的成功应用案例","AI 案例研究, 成功案例, 页面生成, HTMLPAGE","案例研究","content:ai:case-studies.md","ai/case-studies.md","ai/case-studies",1774945280531]