def section_7_2_1(): print("\nSection 7.2.1 Effect of hyper prior updates: first-trial probability") df = pd.DataFrame(columns=['p_forecast_to_static', 'p_forecast_to_hyper']) # forces the columns to appear in this order row_inputs = [ [{'ftp': 1 / 100}, {'ftp': 1 / 1000}], [{'ftp': 1 / 10}, {'ftp': 1 / 100}], [{'ftp': 1 / 10}, {'ftp': 1 / 100}, {'ftp': 1 / 1000}], [{'ftp': 1 / 1000}, {'ftp': 1 / 10000}] ] for input_list in row_inputs: rowname = str([to_fraction_strings(i) for i in input_list]) for rule in input_list: # the same for every row in the table rule['name'] = 'calendar' rule['regime_start'] = 1956 rule['forecast_from'] = 2020 initial_weights = [1] * len(input_list) datadict = functions.hyper_prior(rules=input_list, initial_weights=initial_weights) datadict = to_percentage_strings(datadict) df = df.append(pd.Series(name=rowname, data=datadict)) print(df)
def update_hyper_prior(self): rules_dicts = [] weights = [] rules_attributes = [self.agi_impossible, self.lifetime, self.evolution] # consider refactoring around this ugly code. would require some change to how hyper_prior takes args. if self.calendar: rules_attributes.append(self.calendar) self.calendar.input_args['name'] = 'calendar' if self.researcher: rules_attributes.append(self.researcher) self.researcher.input_args['name'] = 'res-year' if self.comp_relative_res: rules_attributes.append(self.comp_relative_res) self.comp_relative_res.input_args['name'] = 'computation' self.lifetime.input_args['name'] = 'computation' self.lifetime.input_args['biohypothesis'] = 'lifetime' self.evolution.input_args['name'] = 'computation' self.evolution.input_args['biohypothesis'] = 'evolution' if not rules_attributes: return for rule in rules_attributes: rules_dicts.append(rule.input_args) weights.append(rule.init_weight) init_weights_normalized = np.asarray(weights)/sum(weights) # We create the data here instead of passing a callable because it's far more efficient to generate the whole sequence in one call to functions.hyper_prior hyper_results = {} for year in range(2020,self.update_hyper_from + 1): hyper_results[year] = {'p_forecast_to_hyper': 0} forecast_years = generate_years_to_forecast((self.update_hyper_from,2100), fine_interval=3, coarse_interval=15) hyper_results.update(functions.hyper_prior(rules_dicts,weights, forecast_years_explicit=forecast_years, return_sequence=True)) for i in range(len(rules_attributes)): rules_attributes[i].weight2020 = to_percentage_strings(hyper_results[self.update_hyper_from + 1]['wts_forecast_from'][i]) rules_attributes[i].weight_init_normalized = to_percentage_strings(init_weights_normalized[i]) self.pAGI_hyper = hyper_results self.pAGI_2036_hyper = to_percentage_strings(hyper_results[2036]['p_forecast_to_hyper'])
def section_7_3(): print("\n7.3 Allow some probability that AGI is impossible") df = pd.DataFrame(columns=['pr2036 calendar-year', 'pr2036 20% impossible']) # forces this order input_ftps = [ 1 / 1000, 1 / 300, 1 / 200, 1 / 100, 1 / 50, 1 / 20, 1 / 10 ] rows = [] for input_ftp in input_ftps: rows.append( [ {'name': 'calendar', # Rule 1 'regime_start': 1956, 'ftp': input_ftp}, {'name': 'impossible'} # Rule 2 ] ) for row in rows: rowname = to_fraction_strings(row[0]['ftp']) datadict = functions.hyper_prior(row, initial_weights=[.8, .2]) datadict['pr2036 20% impossible'] = datadict.pop('p_forecast_to_hyper') datadict['wt2020'] = datadict.pop('wts_forecast_from')[1] datadict['pr2036 calendar-year'] = functions.four_param_framework_calendar(row[0]['ftp']) datadict = to_percentage_strings(datadict) df = df.append(pd.Series(name=rowname, data=datadict)) print(df)
def section_8(): print("\nSection 8: All-things considered judgement") row_inputs = [ {'name':'low', 'rules': [ { # Rule 1 'name': 'calendar', 'virtual_successes': 0.5, 'regime_start': 1956, 'ftp': 1 / 1000, }, { # Rule 2 'name': 'res-year', 'virtual_successes': 0.5, 'regime_start': 1956, 'ftp_cal_equiv': 1 / 1000, 'g_exp': 4.3 / 100, 'g_act': 7 / 100, }, { # Rule 3 'name': 'impossible', } ], 'weights': [50, 30, 20] }, {'name':'central', 'rules': [ { # Rule 1 'name': 'calendar', 'regime_start': 1956, 'ftp': 1 / 300, }, { # Rule 2 'name': 'res-year', 'regime_start': 1956, 'ftp_cal_equiv': 1 / 300, 'g_exp': 4.3 / 100, 'g_act': 11 / 100, }, { # Rule 3 'name': 'computation', 'spend2036': 'central', 'rel_imp_res_comp': 5, 'g_exp': 4.3 / 100, 'ftp_cal_equiv': 1 / 300, 'regime_start': 1956, }, { # Rule 4 'name': 'computation', 'spend2036': 'central', 'biohypothesis': 'lifetime', 'regime_start': 1956 }, { # Rule 5 'name': 'computation', 'spend2036': 'central', 'biohypothesis': 'evolution' }, { # Rule 6 'name': 'impossible', }, ], 'weights': [ .30, # Rule 1 .30, # Rule 2 .05, # Rule 3 .10, # Rule 4 .15, # Rule 5 .10 # Rule 6 ] }, {'name':'high', 'rules': [ { # Rule 1 'name': 'calendar', 'regime_start': 2000, 'ftp': 1 / 100, }, { # Rule 2 'name': 'res-year', 'regime_start': 2000, 'ftp_cal_equiv': 1 / 100, 'g_exp': 4.3 / 100, 'g_act': 16 / 100, }, { # Rule 3 'name': 'computation', 'spend2036': 'aggressive', 'rel_imp_res_comp': 5, 'regime_start': 1956, 'g_exp': 4.3 / 100, 'ftp_cal_equiv': 1 / 100, }, { # Rule 4 'name': 'computation', 'spend2036': 'aggressive', 'biohypothesis': 'lifetime', 'regime_start': 1956, }, { # Rule 5 'name': 'computation', 'spend2036': 'aggressive', 'biohypothesis': 'evolution', }, { # Rule 6 'name': 'impossible', }, ], 'weights': [ .10, # Rule 1 .40, # Rule 2 .10, # Rule 3 .10, # Rule 4 .20, # Rule 5 .10, # Rule 6 ] } ] print('P(AGI by 2036)') for row in row_inputs: datadict = functions.hyper_prior(row['rules'], initial_weights=row['weights'], forecast_to=2036) print(row['name'],to_percentage_strings(datadict['p_forecast_to_hyper'])) print('P(AGI by 2100)') for row in row_inputs: datadict = functions.hyper_prior(row['rules'], initial_weights=row['weights'], forecast_to=2100) print(row['name'], to_percentage_strings(datadict['p_forecast_to_hyper'])) central = row_inputs[1] datadict = functions.hyper_prior(central['rules'], initial_weights=central['weights'], forecast_from=2025) print("Central estimate conditional on no AGI by 2025:",to_percentage_strings(datadict['p_forecast_to_hyper']))
def appendix_9(): print("\nAppendix 9: AGI Impossible") df = pd.DataFrame(columns=['pr2036 No Hyper', 'pr2036 20% impossible']) # forces order rule2 = {'name': 'impossible'} # the same in every row row_inputs = [ [ {'name': 'calendar', 'ftp': 1 / 300, 'regime_start': 1956}, rule2], [ {'name': 'res-year', 'ftp_cal_equiv': 1 / 300, 'g_act': 11 / 100, 'g_exp': 4.3 / 100, 'regime_start': 1956}, rule2], [ {'name': 'res-year', 'ftp_cal_equiv': 1 / 300, 'g_act': 21 / 100, 'g_exp': 4.3 / 100, 'regime_start': 1956}, rule2], [ {'name': 'res-year', 'ftp_cal_equiv': 1 / 300, 'g_act': 21 / 100, 'g_exp': 4.3 / 100, 'regime_start': 2000}, rule2], [ {'name': 'computation', 'spend2036': 'aggressive', 'ftp_cal_equiv': 1 / 300, 'g_exp': 4.3 / 100, 'rel_imp_res_comp': 5, 'regime_start': 1956}, rule2], [ {'name': 'computation', 'spend2036': 'aggressive', 'ftp_cal_equiv': 1 / 300, 'g_exp': 4.3 / 100, 'rel_imp_res_comp': 1, 'regime_start': 1956}, rule2], [ {'name': 'computation', 'spend2036': 'aggressive', 'biohypothesis': 'lifetime', 'regime_start': 1956}, rule2], [ {'name': 'computation', 'spend2036': 'aggressive', 'biohypothesis': 'evolution'}, rule2], [ {'name': 'computation-loguniform', 'spend2036': 'aggressive'}, rule2], ] for row in row_inputs: rowname = str(row) datadict = functions.hyper_prior(row, initial_weights=[0.8, 0.2]) datadict['pr2036 20% impossible'] = datadict.pop('p_forecast_to_hyper') datadict['wt2020'] = datadict.pop('wts_forecast_from')[1] datadict['pr2036 No Hyper'] = functions.hyper_prior(row, initial_weights=[1, 0])['p_forecast_to_hyper'] datadict = to_percentage_strings(datadict) df = df.append(pd.Series(name=rowname, data=datadict)) print(df)
def appendix_8(): print("\nAppendix 8: using a hyper-prior on different trial definitions") df = pd.DataFrame(columns=['p_forecast_to_static', 'p_forecast_to_hyper']) # forces the columns to appear in this order # First rule is the same in all rows rule1 = {'name': 'calendar', 'regime_start': 1956, 'ftp': 1 / 300 } row_inputs = [ [rule1, {'name': 'res-year', 'ftp_cal_equiv': 1 / 300, 'g_exp': 4.3 / 100, 'g_act': 11 / 100, 'regime_start': 1956} ], [rule1, {'name': 'res-year', 'ftp_cal_equiv': 1 / 300, 'g_exp': 4.3 / 100, 'g_act': 21 / 100, 'regime_start': 1956}, ], [rule1, {'name': 'res-year', 'ftp_cal_equiv': 1 / 300, 'g_exp': 4.3 / 100, 'g_act': 21 / 100, 'regime_start': 2000} ], [rule1, {'name': 'computation', 'ftp_cal_equiv': 1 / 300, 'g_exp': 4.3 / 100, 'rel_imp_res_comp': 5, 'regime_start': 1956, 'spend2036': 'aggressive'}, ], [rule1, {'name': 'computation', 'ftp_cal_equiv': 1 / 300, 'g_exp': 4.3 / 100, 'rel_imp_res_comp': 1, 'regime_start': 1956, 'spend2036': 'aggressive'} ], [rule1, {'name': 'computation', 'biohypothesis': 'lifetime', 'regime_start': 1956, 'spend2036': 'aggressive'}, ], [rule1, {'name': 'computation', 'biohypothesis': 'evolution', 'spend2036': 'aggressive'} ] ] for input_list in row_inputs: rowname = str(to_fraction_strings(input_list[1])) initial_weights = [1] * len(input_list) datadict = functions.hyper_prior(input_list, initial_weights) # We only display the second weight datadict['wt2020'] = datadict['wts_forecast_from'][1] del datadict['wts_forecast_from'] datadict = to_percentage_strings(datadict) df = df.append(pd.Series(name=rowname, data=datadict)) print(df)