PNM-Negotiate

A language model based on Paraconsistent Negotiated Mathematics.

Architecture

Standard causal transformer with two extra heads:

  • Commitment head: outputs a_t ∈ (0,1) per token
  • Denial head: outputs b_t ∈ (0,1) per token

A token with a_t > 0.5 and b_t > 0.5 is a negotiated token β€” simultaneously asserted and denied. The model does not collapse contradictions; it represents them.

Training

Loss = cross-entropy + Ξ» Β· mean(a_t Β· b_t)

The tension term penalizes simultaneous high commitment and denial, but does not forbid it.

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained(
    "zeechimp/pnm-negotiate",
    trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained("zeechimp/pnm-negotiate")

inputs = tokenizer("The truth is", return_tensors="pt")
out = model.generate(**inputs, max_new_tokens=32, return_commitment=True)
print(tokenizer.decode(out[0]))
print("Commitment:", out.commitment[0, -1].max().item())
print("Denial:     ", out.denial[0, -1].max().item())

## Limitations

- The negotiation loss is a soft constraint, not a hard one.
- The model can still collapse to `a β‰ˆ b β‰ˆ 0.5` for all tokens if the tension weight is too high.
- No theoretical guarantee that the fixed point is unique.

Running It

pip install transformers torch datasets tokenizers huggingface_hub
python train_pnm.py

The training script uses WikiText-2 as a stand-in. Replace with your own corpus. The model pushes to your-username/pnm-negotiate after training.


What This Model Actually Does

The commitment_head and denial_head are trained to predict, for each token, how much the model asserts it and how much it denies it. The negotiation loss mean(a Β· b) pushes the model to keep these two quantities from both being high β€” but does not forbid it. The result is a model that can output a token with a = 0.7, b = 0.4 β€” asserted and denied simultaneously.

This is the only architectural change from a standard causal LM. Everything else is standard. The PNM structure lives entirely in the two extra heads and the auxiliary loss.

To verify the claim, after training, inspect the commitment/denial values on a contradictory prompt like "This statement is false". If the model has learned the PNM structure, you should see elevated denial alongside commitment β€” not a collapse to one or the other. If it has not, the heads will have collapsed to a β‰ˆ 1, b β‰ˆ 0 (standard LM behavior) or a β‰ˆ b β‰ˆ 0.5 (tension-dominated collapse). Both are failures of the negotiation, and both are measurable.

Downloads last month
91
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support