Skip to content

armgit / laya

Public Imported from GitHub
0

Non-autoregressive System 1 decision engine. Typed choice, score and yes/no decisions over any text in a single forward pass, in 100+ languages, with a router that picks the right checkpoint per request.

19.7 KB
Raw Blame
{
  "name": "budget_head_squeezed",
  "state": "Subject: Double charged on invoice 88213\n\nHi, I was billed twice this month for the Pro plan and the second charge has not been refunded. This is the third time I have written in. If it is not fixed today I am cancelling the account.",
  "serialized_state": "Subject: Double charged on invoice 88213\n\nHi, I was billed twice this month for the Pro plan and the second charge has not been refunded. This is the third time I have written in. If it is not fixed today I am cancelling the account.",
  "questions": {
    "department": {
      "type": "choice",
      "instructions": "Which department should handle this?",
      "criteria": {
        "billing": "invoices, payments, double charges, refunds",
        "technical": "bugs, outages, integration errors",
        "account": "logins, seats, plan changes"
      }
    },
    "urgency": {
      "type": "score",
      "instructions": "How urgent is this request?",
      "criteria": [
        "not urgent",
        "this week",
        "today",
        "drop everything"
      ]
    },
    "churn_risk": {
      "type": "noul",
      "instructions": "The customer threatens to cancel the account."
    },
    "needs_human": {
      "type": "noul",
      "instructions": "This requires a human agent rather than an automated reply.",
      "criteria": {
        "false": "a template reply resolves it",
        "true": "a person must intervene"
      }
    }
  },
  "per_question": [
    {
      "id": "department",
      "type": "choice",
      "qtype": 0,
      "instructions": "Which department should handle this?",
      "head_text": "choice question: Which department should handle this?",
      "options": [
        "billing: invoices, payments, double charges, refunds",
        "technical: bugs, outages, integration errors",
        "account: logins, seats, plan changes"
      ],
      "input_ids": [
        2,
        6241,
        2872,
        235292,
        12236,
        9888,
        1412,
        6589,
        736,
        235336,
        1,
        4,
        54972,
        235292,
        88220,
        4,
        9838,
        235292,
        30608,
        4,
        3185,
        235292,
        12138,
        1,
        28437,
        235292,
        12510,
        12497,
        611,
        42529,
        235248,
        235321,
        235321,
        235284,
        235274,
        235304,
        109,
        11192,
        235269,
        590,
        729,
        100159,
        11594,
        736,
        2514,
        604,
        573,
        1122,
        1780,
        578,
        573,
        2257,
        6256,
        919,
        780,
        1125,
        103147,
        235265,
        1417,
        603,
        573,
        4906,
        1069,
        590,
        791,
        5952,
        575,
        235265,
        1927,
        665,
        603,
        780,
        8115,
        3646,
        590,
        1144,
        132991,
        573,
        3185,
        235265,
        1
      ],
      "markers": [
        11,
        15,
        19
      ]
    },
    {
      "id": "urgency",
      "type": "score",
      "qtype": 1,
      "instructions": "How urgent is this request?",
      "head_text": "score question: How urgent is this request?",
      "options": [
        "level 0: not urgent",
        "level 1: this week",
        "level 2: today",
        "level 3: drop everything"
      ],
      "input_ids": [
        2,
        7716,
        2872,
        235292,
        2250,
        34722,
        603,
        736,
        3853,
        235336,
        1,
        4,
        2403,
        235248,
        235276,
        4,
        2403,
        235248,
        235274,
        4,
        2403,
        235248,
        235284,
        4,
        2403,
        235248,
        235304,
        1,
        28437,
        235292,
        12510,
        12497,
        611,
        42529,
        235248,
        235321,
        235321,
        235284,
        235274,
        235304,
        109,
        11192,
        235269,
        590,
        729,
        100159,
        11594,
        736,
        2514,
        604,
        573,
        1122,
        1780,
        578,
        573,
        2257,
        6256,
        919,
        780,
        1125,
        103147,
        235265,
        1417,
        603,
        573,
        4906,
        1069,
        590,
        791,
        5952,
        575,
        235265,
        1927,
        665,
        603,
        780,
        8115,
        3646,
        590,
        1144,
        132991,
        573,
        3185,
        235265,
        1
      ],
      "markers": [
        11,
        15,
        19,
        23
      ]
    },
    {
      "id": "churn_risk",
      "type": "noul",
      "qtype": 2,
      "instructions": "The customer threatens to cancel the account.",
      "head_text": "noul question: The customer threatens to cancel the account.",
      "options": [
        "false: no, the statement does not hold",
        "true: yes, the statement holds"
      ],
      "input_ids": [
        2,
        552,
        6311,
        2872,
        235292,
        714,
        6650,
        80670,
        577,
        12459,
        573,
        3185,
        235265,
        1,
        4,
        1566,
        235292,
        793,
        235269,
        573,
        6218,
        4,
        1382,
        235292,
        7778,
        235269,
        573,
        6218,
        1,
        28437,
        235292,
        12510,
        12497,
        611,
        42529,
        235248,
        235321,
        235321,
        235284,
        235274,
        235304,
        109,
        11192,
        235269,
        590,
        729,
        100159,
        11594,
        736,
        2514,
        604,
        573,
        1122,
        1780,
        578,
        573,
        2257,
        6256,
        919,
        780,
        1125,
        103147,
        235265,
        1417,
        603,
        573,
        4906,
        1069,
        590,
        791,
        5952,
        575,
        235265,
        1927,
        665,
        603,
        780,
        8115,
        3646,
        590,
        1144,
        132991,
        573,
        3185,
        235265,
        1
      ],
      "markers": [
        14,
        21
      ]
    },
    {
      "id": "needs_human",
      "type": "noul",
      "qtype": 2,
      "instructions": "This requires a human agent rather than an automated reply.",
      "head_text": "noul question: This requires a human agent rather than an automated reply.",
      "options": [
        "false: a template reply resolves it",
        "true: a person must intervene"
      ],
      "input_ids": [
        2,
        552,
        6311,
        2872,
        235292,
        1417,
        9286,
        476,
        3515,
        10588,
        4644,
        1178,
        671,
        34177,
        7260,
        235265,
        1,
        4,
        1566,
        235292,
        476,
        11387,
        7260,
        116075,
        4,
        1382,
        235292,
        476,
        1552,
        2004,
        75103,
        1,
        28437,
        235292,
        12510,
        12497,
        611,
        42529,
        235248,
        235321,
        235321,
        235284,
        235274,
        235304,
        109,
        11192,
        235269,
        590,
        729,
        100159,
        11594,
        736,
        2514,
        604,
        573,
        1122,
        1780,
        578,
        573,
        2257,
        6256,
        919,
        780,
        1125,
        103147,
        235265,
        1417,
        603,
        573,
        4906,
        1069,
        590,
        791,
        5952,
        575,
        235265,
        1927,
        665,
        603,
        780,
        8115,
        3646,
        590,
        1144,
        132991,
        573,
        3185,
        235265,
        1
      ],
      "markers": [
        17,
        24
      ]
    }
  ],
  "batch": {
    "input_ids": [
      [
        2,
        6241,
        2872,
        235292,
        12236,
        9888,
        1412,
        6589,
        736,
        235336,
        1,
        4,
        54972,
        235292,
        88220,
        4,
        9838,
        235292,
        30608,
        4,
        3185,
        235292,
        12138,
        1,
        28437,
        235292,
        12510,
        12497,
        611,
        42529,
        235248,
        235321,
        235321,
        235284,
        235274,
        235304,
        109,
        11192,
        235269,
        590,
        729,
        100159,
        11594,
        736,
        2514,
        604,
        573,
        1122,
        1780,
        578,
        573,
        2257,
        6256,
        919,
        780,
        1125,
        103147,
        235265,
        1417,
        603,
        573,
        4906,
        1069,
        590,
        791,
        5952,
        575,
        235265,
        1927,
        665,
        603,
        780,
        8115,
        3646,
        590,
        1144,
        132991,
        573,
        3185,
        235265,
        1,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      [
        2,
        7716,
        2872,
        235292,
        2250,
        34722,
        603,
        736,
        3853,
        235336,
        1,
        4,
        2403,
        235248,
        235276,
        4,
        2403,
        235248,
        235274,
        4,
        2403,
        235248,
        235284,
        4,
        2403,
        235248,
        235304,
        1,
        28437,
        235292,
        12510,
        12497,
        611,
        42529,
        235248,
        235321,
        235321,
        235284,
        235274,
        235304,
        109,
        11192,
        235269,
        590,
        729,
        100159,
        11594,
        736,
        2514,
        604,
        573,
        1122,
        1780,
        578,
        573,
        2257,
        6256,
        919,
        780,
        1125,
        103147,
        235265,
        1417,
        603,
        573,
        4906,
        1069,
        590,
        791,
        5952,
        575,
        235265,
        1927,
        665,
        603,
        780,
        8115,
        3646,
        590,
        1144,
        132991,
        573,
        3185,
        235265,
        1,
        0,
        0,
        0,
        0
      ],
      [
        2,
        552,
        6311,
        2872,
        235292,
        714,
        6650,
        80670,
        577,
        12459,
        573,
        3185,
        235265,
        1,
        4,
        1566,
        235292,
        793,
        235269,
        573,
        6218,
        4,
        1382,
        235292,
        7778,
        235269,
        573,
        6218,
        1,
        28437,
        235292,
        12510,
        12497,
        611,
        42529,
        235248,
        235321,
        235321,
        235284,
        235274,
        235304,
        109,
        11192,
        235269,
        590,
        729,
        100159,
        11594,
        736,
        2514,
        604,
        573,
        1122,
        1780,
        578,
        573,
        2257,
        6256,
        919,
        780,
        1125,
        103147,
        235265,
        1417,
        603,
        573,
        4906,
        1069,
        590,
        791,
        5952,
        575,
        235265,
        1927,
        665,
        603,
        780,
        8115,
        3646,
        590,
        1144,
        132991,
        573,
        3185,
        235265,
        1,
        0,
        0,
        0
      ],
      [
        2,
        552,
        6311,
        2872,
        235292,
        1417,
        9286,
        476,
        3515,
        10588,
        4644,
        1178,
        671,
        34177,
        7260,
        235265,
        1,
        4,
        1566,
        235292,
        476,
        11387,
        7260,
        116075,
        4,
        1382,
        235292,
        476,
        1552,
        2004,
        75103,
        1,
        28437,
        235292,
        12510,
        12497,
        611,
        42529,
        235248,
        235321,
        235321,
        235284,
        235274,
        235304,
        109,
        11192,
        235269,
        590,
        729,
        100159,
        11594,
        736,
        2514,
        604,
        573,
        1122,
        1780,
        578,
        573,
        2257,
        6256,
        919,
        780,
        1125,
        103147,
        235265,
        1417,
        603,
        573,
        4906,
        1069,
        590,
        791,
        5952,
        575,
        235265,
        1927,
        665,
        603,
        780,
        8115,
        3646,
        590,
        1144,
        132991,
        573,
        3185,
        235265,
        1
      ]
    ],
    "attention_mask": [
      [
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      [
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        0,
        0,
        0,
        0
      ],
      [
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        0,
        0,
        0
      ],
      [
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1
      ]
    ],
    "marker_pos": [
      [
        11,
        15,
        19,
        0
      ],
      [
        11,
        15,
        19,
        23
      ],
      [
        14,
        21,
        0,
        0
      ],
      [
        17,
        24,
        0,
        0
      ]
    ],
    "marker_mask": [
      [
        true,
        true,
        true,
        false
      ],
      [
        true,
        true,
        true,
        true
      ],
      [
        true,
        true,
        false,
        false
      ],
      [
        true,
        true,
        false,
        false
      ]
    ],
    "qtype": [
      0,
      1,
      2,
      2
    ]
  },
  "marker_axis_padded": false,
  "logits": [
    [
      10.212523460388184,
      -4.56038761138916,
      -1.4936447143554688,
      -10000.0
    ],
    [
      -4.571069717407227,
      -4.580554485321045,
      -4.4913330078125,
      -0.8970227241516113
    ],
    [
      2.538928985595703,
      -0.10721355676651001,
      -10000.0,
      -10000.0
    ],
    [
      1.5369144678115845,
      -0.2392333745956421,
      -10000.0,
      -10000.0
    ]
  ],
  "act_logits": [
    [
      1314.9737548828125,
      -1569.94580078125
    ],
    [
      1547.6978759765625,
      -1827.34619140625
    ],
    [
      1295.5511474609375,
      -1537.988525390625
    ],
    [
      1280.4407958984375,
      -1520.9874267578125
    ]
  ],
  "result": {
    "model": "laya-rl-agent",
    "answers": {
      "department": {
        "type": "choice",
        "choice": "billing",
        "probabilities": {
          "billing": 1.0,
          "technical": 0.0,
          "account": 0.0
        },
        "confidence": 0.9999,
        "answer_confidence": 1.0,
        "action": {
          "act_probability": 1.0
        }
      },
      "urgency": {
        "type": "score",
        "score": 2.8573,
        "legend": {
          "0": "not urgent",
          "1": "this week",
          "2": "today",
          "3": "drop everything"
        },
        "probabilities": {
          "0": 0.0235,
          "1": 0.0233,
          "2": 0.0255,
          "3": 0.9277
        },
        "confidence": 0.7554,
        "answer_confidence": 0.9277,
        "action": {
          "act_probability": 1.0
        }
      },
      "churn_risk": {
        "type": "noul",
        "noul": 0.0662,
        "confidence": 0.9338,
        "answer_confidence": 0.9338,
        "action": {
          "act_probability": 1.0
        }
      },
      "needs_human": {
        "type": "noul",
        "noul": 0.1448,
        "confidence": 0.8552,
        "answer_confidence": 0.8552,
        "action": {
          "act_probability": 1.0
        }
      }
    },
    "usage": {
      "input_tokens": 341,
      "output_tokens": 0,
      "state_tokens": 56,
      "state_tokens_dropped": 0,
      "truncated": false,
      "truncated_questions": []
    }
  },
  "options": {
    "head_max_len": 30
  }
}