1. 基础奖励计算公式
$$ Token奖励 = 基础奖励 × (1 + 0.5 × (加权分数 / 10000)^2 × e^(加权分数 / 5000)) $$
加权分数 = 互动分数 × 质量系数 × 时效系数<aside> 🗣
基础奖励设定为默认值1000默认值可以更改,此处仅为一个默认值
</aside>
2. 加权分数构成
互动分数计算:
$$ 互动分数=(评论数×3)+(转发数×2)+点赞数 $$
设置10000上限以防范数据作弊
质量系数划分:
1.5(高质量内容)0.05 ~ 0.1:质量系数为1.2(中质量内容)1.0(低质量内容)时效系数评定:
在不同时间范围内达到基准互动量(基准互动量可以设定为10评论,6转发,50点赞)时:
1.31.11.03. 奖励增长特点
4. 解锁期限动态调整
3个月4个月5个月3个月,确保奖励具有一定约束5. 特殊激励措施
5000分,Token奖励增加10%8000分,Token奖励增加5%6. 奖励曲线分析
0到10000的奖励变化,展示奖励随分数提高而变陡峭的趋势
代码实现
import numpy as np
import matplotlib.pyplot as plt
class KOLRewardSystem:
def **init**(self, base_reward=1000, base_unlock_period=6):
self.base_reward = base_reward
self.base_unlock_period = base_unlock_period
def calculate_interaction_score(self, comments, retweets, likes):
"""计算互动分数"""
return min((3 * comments) + (2 * retweets) + likes, 10000)
def calculate_quality_coefficient(self, comments, likes):
"""计算质量系数"""
ratio = comments / max(likes, 1) # 防止除以0
if ratio > 0.1:
return 1.5
elif 0.05 <= ratio <= 0.1:
return 1.2
else:
return 1.0
def calculate_timeliness_coefficient(self, hours):
"""计算时效系数"""
if hours <= 24:
return 1.3
elif hours <= 48:
return 1.1
else:
return 1.0
def calculate_token_reward(self, score, quality_coeff, timeliness_coeff):
"""计算Token奖励,基于指数型加权二次函数"""
weighted_score = score * quality_coeff * timeliness_coeff
reward_multiplier = 1 + 0.5 * (weighted_score / 10000) ** 2 * np.exp(weighted_score / 5000)
return self.base_reward * reward_multiplier
def calculate_unlock_period(self, monthly_cumulative_score):
"""根据月度累积分数动态调整解锁期限"""
if monthly_cumulative_score >= 500000:
return max(3, self.base_unlock_period - 3)
elif monthly_cumulative_score >= 200000:
return max(3, self.base_unlock_period - 2)
elif monthly_cumulative_score >= 100000:
return max(3, self.base_unlock_period - 1)
else:
return self.base_unlock_period
def apply_special_incentives(self, token_reward, daily_scores):
"""应用特殊激励"""
if any(score >= 5000 for score in daily_scores):
token_reward *= 1.1
if max(daily_scores) > 8000:
token_reward *= 1.05
return token_reward
def visualize_reward_curve(self):
"""可视化奖励曲线"""
scores = np.linspace(0, 10000, 500)
quality_coeff = 1.2
timeliness_coeff = 1.1
rewards = [
self.calculate_token_reward(score, quality_coeff, timeliness_coeff) for score in scores
]
plt.figure(figsize=(12, 6))
plt.plot(scores, rewards, label="奖励曲线", color="blue")
plt.title("KOL奖励模型 - 指数型加权二次函数")
plt.xlabel("互动分数")
plt.ylabel("Token奖励")
plt.grid(True)
plt.legend()
plt.show()
if **name** == "**main**":
# 创建模型实例
model = KOLRewardSystem()
# 示例数据
comments, retweets, likes = 300, 400, 1000
interaction_score = model.calculate_interaction_score(comments, retweets, likes)
quality_coeff = model.calculate_quality_coefficient(comments, likes)
timeliness_coeff = model.calculate_timeliness_coefficient(20) # 假设20小时内达到基准互动量
# 计算奖励
reward = model.calculate_token_reward(interaction_score, quality_coeff, timeliness_coeff)
print(f"互动分数: {interaction_score}")
print(f"质量系数: {quality_coeff}")
print(f"时效系数: {timeliness_coeff}")
print(f"Token奖励: {reward}")
# 动态解锁期限
unlock_period = model.calculate_unlock_period(300000)
print(f"解锁期限: {unlock_period}个月")
# 可视化奖励曲线
model.visualize_reward_curve()